autotools: Use STAGING_DATADIR_NATIVE for config.rpath

For builds that don't use gettext, config.rpath may not exist in the target
datadir. This change uses the native directory where it will always
be present due to gettext-minimal-native (which allows us to autoreconf
recipes using gettext even if we don't have gettext built).

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
grep: Fix gplv2 version to work with recent gettext

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
sed: Fix gplv2 version to work with recent gettext

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
diffutils: Fix gplv2 version to work with recent gettext

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bison: Fix gplv2 version to work with recent gettext

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
perl: fix dependecies

This patch fixes 2 problems.

The first one is that when run "perl -V" on target, it fails with lack
of some .pm files. So add these perl module files to package perl itself
to fix this failure.

The second problem is that package nativesdk-perl-modules doesn't depends
on the single perl modules.

In the .bb file, dependencies of perl-modules are set by:

RRECOMMENDS_perl-modules = "${@d.getVar('PACKAGES', True)...}"

The PACKAGES would be reset by do_split_packages since:

PACKAGES_DYNAMIC = "perl-module-*"
PACKAGES_DYNAMIC_virtclass-nativesdk = "nativesdk-perl-module-*"

Then:
1) The target perl-modules RRECOMMENDS on perl-module-*, this is what
   we expect.

2) But the nativesdk-perl-modules doesn't RRECOMMENDS on
   nativesdk-perl-module-*, this is not what we expect.

The value of PACKAGES after do_split_packages has been set correctly (it
contains the nativesdk-perl-module-* packages)

But the:

RRECOMMENDS_perl-modules = "${@d.getVar('PACKAGES', True)...}"

doesn't work correctly for nativesdk, the

d.getVar('RRECOMMENDS_perl-modules', True)

doesn't get the new value of the PACKAGES, it gets the value of PACKAGES
before the do_split_packages.

This patch will fix the problem.

Signed-off-by: Kang Kai <kai.kang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
kernel.bbclass: remove explicit version.h target

The compilation routine for the kernel has an explicit call to
build version.h, which works fine for most kernels, but the
location of it has recently changes.

commit d183e6f5 [UAPI: Move linux/version.h]
commit 10b63956 [UAPI: Plumb the UAPI Kbuilds into the user
                 header installation and checking]

moves the file to include/generated/linux/version.h and then to
include/generated/uapi/linux/version.h.

As a result kernel builds of 3.7 or bisection builds of intermediate
kernel commits will fail with:

  make[2]: *** No rule to make target `include/linux/version.h'.  Stop.

Making the explicit version.h build conditional on the version, or
via a file test would fix the problem, but it introduces some complexity
to the build.

Even without an explicit call to build version.h, it is always produced
by the kernel build, so it can simply be removed.

This extra make line was originally so that the kernel version could be
determined, so that then different instructions could be executed depending
on whether it was a 2.4 or 2.6 kernel. Since we no longer support 2.4, this
code is no longer needed.

[YOCTO: #3293]

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
console-tools: Fix build issues with make 3.82

The intl directory is part of older gettext and has macros which no
longer get expanded with recent gettext versions. This simply removes
the intl directory from the equation since we'd never need it.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
PACKAGES_DYNAMIC: use regexp not glob

* bitbake uses PACKAGES_DYNAMIC as regexp
  ^ could make matching faster (and it will be more clear that we're expecting regexp not glob)
  * made all those last '-' optional, use .* (or nothing)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
PACKAGES_DYNAMIC: use += instead of = in most cases

* to keep ${PN}-locale from
  bitbake.conf:PACKAGES_DYNAMIC = "^${PN}-locale-.*"

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
kernel.bbclass: add kernel-modules to PACKAGES

* kernel-modules is always added to PACKAGES later in python code and
  needed to be defined as PACKAGES_DYNAMIC
* add it to PACKAGES directly and set
  ALLOW_EMPTY_kernel-modules
  FILES_kernel-modules
  DESCRIPTION_kernel-modules
  outside populate_packages_prepend like for other packages and set only
  RDEPENDS_kernel-modules from python code

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
perl: Fix perl module dependency issues

With the move of the strict/vars/config/warnings modules to the main perl
recipe, we need to RPROVIDE those modules to ensure that package dependencies
on those modules continue to work correctly.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
base.bbclass: Add PKGTRIPLETS and PKGMLTRIPLETS variables

These variables correspond to the PACKAGE_ARCH list combined with the TARGET_VENDOR
and TARGET_OS values. These can be used to traverse the pkgdata structure.

Setting these once in base.bbclass stops pkgdata needing to recalculate the values
and is also useful for the reworked shlibs code in a patch that will follow this.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/oe/packagedata: Use the PKGMLTRIPLETS variable

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
package.bbclass: Switch shlibs to pkgdata directory and make package non-machine specific

Currently, do_package is machine specific since the shlibs data is installed
into each machine specific sysroot. This change moves the shlibs data to the
pkgdata structure, at the expense of having to iterate over a set of shlibs
directories instead of a single one.

It turns out this isn't any particular hardship for the code and as a result,
do_package stops being machine specific leading to optimisations for builds
that use a common PACKAGE_ARCH.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
sstate: Improve handling of machine specific manifests

Now do_package isn't machine specific, we're only left with do_populate_sysroot as a
machine specific task. This change marks only the machine specific manifests as machine
specific, defaulting to PACKAGE_ARCH for everything else.

This means we do less work where there are multiple machines using the same
core package architecture and we can start to clean up the sstate duplicate files
whitelist.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
multilib/clsextend: Improve handling of regexps in PACKAGES_DYNAMIC

Now that PACKAGES_DYNAMIC is more standardised, starting with ^ anchors,
the variable manipulations performed by clsextend for multilib don't work.

This patch at least improves it to hack around the problem and enable
mulitlib builds to work again. If this code doesn't do the right thing, the
recipe is free to override the variable with the correct multilib case.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
package.bbclass: Exclude the PKGTRIPLETS variable

Without this, we'd rerun packaging for every machine since this variable contains
a machine specific component.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
eglibc: Move perl- and bash-using scripts to separate recipes

This removes the dependency of eglibc.bb itself on perl and bash
which, in turn, eliminates the need to build those two recipes if the
scripts which need them are not going to be installed.

Also provide dummy do_evacuate_scripts() for all variants of eglibc-initial
otherwise the nativesdk and multilib variants might crash trying to
copy a non-existent mtrace script.

Signed-off-by: Phil Blundell <pb@pbcl.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
eglibc-2.16: Use tar ball instead of svn SRC_URI

Adapt the recipes to fetch a tarball.
Tarball is generated from latest 2.16 branch
which has e500-math_private.patch already applied
hence we remove that patch.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>