support/scripts: document args to _is_package() in gen-manual-lists

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Samuel Martin <s.martin49@gmail.com>
Acked-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
support/scripts: prepare handling virtual packages in generated lists

Prepare to tell apart real packages from virtual packages.

Currently, the code implicitly recognises only real packages, and
discards virtual packages, because of the heuristic used to recognise
whether a symbol is a package:

  - for real package:
    - symbols  : BR2_PACKAGE_FOO
    - .mk files: foo.mk
  - for virtual packages:
    - symbols  : BR2_PACKAGE_HAS_FOO
    - .mk files: foo.mk

The current heuristic is to check for each symbol if a corresponding .mk
file exists, by stripping 'BR2_PACKAGE_' from the beginning of the symbol,
converting the result to lowercase, and checking if a .mk file exists.

So, as a side effect, it completely misses the virtual packages [*], which
is pretty nice since we get a list with only real packages that the user
can indeed select and see in the menuconfig.

[*] Except for 'cryptodev' and 'jpeg' which are both virtual packages and
normal packages. Except they are not normal packages, they are used to
display a choice of the implementation to use. This case will be fixed in
follow-up patches.

Since we'll soon need to also output the table of virtual packages, we
need to teach the _is_package() function to recognise them as well.

This patch is the first step into that direction: it introduces a new
function _is_real_package() that is just a wrapper to _is_package(), which
gains a new parameter, being the type of packages to filter on.

No behavioural change is made in this patch, it is just a preparatory
patch.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
support/scripts: do not display virtual packages in generated lists

If a package has both a 'real' and a 'virtual' definition, consider it
is a virtual package and do not display it in the generated package list.

This is the case for jpeg and cryptodev, that are virtual packages, but
also real (but empty) packages used to provide a prompt to enable/disable
a choice to select an implementation. In this case, we do not want to
list the virtual packages, but only their implementations.

So, consider packages that are both real and virtual as virtual packages.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Samuel Martin <s.martin49@gmail.com>
Acked-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
support/scripts: who's responsible to decide what is a package

When generating the package lists, the responsibility to decide what is
actually a package symbol is currently split between the _is_package(),
the get_symbol_subset() and the format_asciidoc_table() functions.

The two latter functions check that an item is really a symbol, and that
is has a prompt.

While this is currently correct for real packages, this will no longer
be the case when we also generate a list of virtual packages, since they
do not have a prompt.

Move the responsibility to verify that a symbol is indeed a package symbol
to _is_package(), so it's all in one place, and makes it easier to change
for virtual packages.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
support/scripts: introduce a symbol formatter to generate package lists

Currently, we can generate two different tables of packages:
  - a single-column table with the symbols' prompts,
  - a two-column table with the symbols' prompts and locations in the
    menuconfig.

For virtual packages, this is not enough, since we will have to display
more columns, with different content:
  - the virtual package name (but such symbols do not have a prompt)
  - the symbol name
  - the providers for the virtual package

So, instead of having a single function that knows how to generate any
table, introduce a formatter function that is passed as argument to,
and called by format_asciidoc_table(). Such formatter functions are
responsible for providing:
  - the layout of the table (number of columns, column arrangement),
  - the formatted header line,
  - a formatted line for a symbol.

What the formatter should ouput depends on its arguments:
  - if none are passed, the layout is returned,
  - if the header label is passed, it returns the formatted header line,
  - otherwise, it returns the formatted line for a symbol.

Two formatter functions are introduced in this changeset, to replace the
current 'sub_menu' feature:
  - _format_symbol_prompt() to display a one-column table with only the
    symbols' prompts,
  - _format_symbol_prompt_location() to display a two-column table with
    the symbols' prompts and locations.

This will help us to later introduce a new formatter to generate a table
for virtual packages.

[Thanks to Samuel for his pythonistic help!]

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
support/scripts: generate a list of virtual packages

Generate an asciidoc table that can be included in the manual, that
lists the existing virtual packages, the corresponding symbols, and
their providers (and sub-options thereof).

The core of this change is the addition of a new formatter for virtual
packages. This formatter is a bit tricky, as it has to catter for a
bunch of corner cases:
  - provider is not a package, but is sub-options of a package
  - such a sub-option may be itself 'select'-ed by one or more
    other sub-options
  - legacy packages should not be considered as a provider

Those cases are real:
  - sub-options of mesa3d provide EGL or GLES
  - selected sub-options of mesa3d provide GL
  - udev is a legacy package, but it provides udev

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
docs/manual: add the virtual packages list

Add the list of virtual packages as an appendix to the manual.

Also reference this list from appropriate locations elsewhere in
the manual:

  - in section 7.2.2. "Config.in file", after the existing explanations
    on dependencies on target and toolchain options, on a linux kernel,
    and on udev /dev management,

  - in section 7.2.10. "Infrastructure for virtual packages", in the
    provider Config.in and .mk explanations, to have the list of existing
    symbols to select (in Config.in) and packages to provide (in .mk).

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Samuel Martin <s.martin49@gmail.com>
Acked-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
perl: removes useless files in target tree

$(TARGET_DIR)/usr/lib/perl5/$(PERL_VERSION)/$(PERL_ARCHNAME)/CORE contains include files.
*.bs & .packlist files come with perl or perl/cpan packages.

Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
wpa_supplicant: fix BR2_PACKAGE_WPA_SUPPLICANT_DEBUG_SYSLOG option

Signed-off-by: Sven Neumann <neumann@teufel.de>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
sshpass: new package

[Thomas: add MMU dependency, fix license to GPLv2+.]

Signed-off-by: Gary Bisson <bisson.gary@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
packages: replace command install by $(INSTALL)

Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
faifa: new package

faifa is a library and a cli used to manage PLC hardware that use
Intellon chipset.  Almost everybody use theses chips nowadays.

[Thomas: license is GPLv2+, not GPLv2. Fix indentation. Add dependency
on host-autoconf and a comment to explain what's going on. Fix
indentation of target/staging installation commands. Mark the package
as not available for static library builds as it always build a shared
library. Rewrap Config.in help text.]

Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/trace-cmd: bump to version 2.3.2

The first patch "use-pkg-config-instead-of-python-config" has been applied
upstream.

The flag _GNU_SOURCE is now always defined in Makefile, so it can be removed
from trace-cmd.mk

CPPFLAGS are appended to CFLAGS and are used to add extra flags, but the flag
_LARGEFILE64_SOURCE in TARGET_CPPFLAGS is already defined in source files,
which causes a build error. As for CFLAGS, we fix this by filtering out our
definition of _LARGEFILE64_SOURCE from the CPPFLAGS before passing them to the
trace-cmd Makefile.

Signed-off-by: Romain Naour <romain.naour@openwide.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/x11r7/xlib_libXfont: Bump version to 1.4.8

Fixes CVE-2014-0209, CVE-2014-0210 & CVE-2014-0211
http://lists.x.org/archives/xorg-announce/2014-May/002431.html

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package infra: remove duplicates in dependencies list

Currently, we just use what a package declares as its dependencies.

But some packages may declare the same depdency more than once. For
example, php has two options to add SQL support: 'mysql' or 'mysqli',
which are not exclusive. So, php.mk has mysql twice as a dependency.

Although that does not cause any grievance for make, we end up generating
dependency graphs where this duplicate dependency is visible.

Add an intermediary variable which contains the $(sort)-ed list of the
dependencies, thus eliminating any duplicates.

This has the side effect of also sorting the list, which is probably
good for reproducibility anyway.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
ti-gfx: use only -I${includedir} as pkg-config Cflags

Using only -I${includedir} in common practice.

Settings only -I${includedir}/GLES2 breaks Qt5's CMake files,
because at configure time CMake only searchs the paths reported
by pkg-config, and not even /usr/include is used as default.

Even though pkg-config strips out standard include path, that's not
the case with pkgconf (which we are using) in cross-compilation,
which correctly reports the /usr/include dir prefixed with the
sysroot.

Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Peter Kümmel <syntheticpp@gmx.net>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
sunxi-mali: use only -I${includedir} as pkg-config Cflags

Using only -I${includedir} in common practice.

Settings only -I${includedir}/GLES2 breaks Qt5's CMake files,
because at configure time CMake only searchs the paths reported
by pkg-config, and not even /usr/include is used as default.

Even though pkg-config strips out standard include path, that's not
the case with pkgconf (which we are using) in cross-compilation,
which correctly reports the /usr/include dir prefixed with the
sysroot.

Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Peter Kümmel <syntheticpp@gmx.net>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/sqlite: Bump version to 3.8.5

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/xbmc-pvr-addons: Bump version, use gotham branch

Suggested by Yann:
http://lists.busybox.net/pipermail/buildroot/2014-June/098698.html

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
uclibc: add patch to fix arch specific eventfd defs

Add uClibc 0.9.33.2 patch to fix arch specific eventfd definitions,
particularly EFD_NONBLOCK. The definition in sys/eventfd.h was 04000
(0x800), however MIPS uses 0200 (0x80). This resulted in QEMU built for
MIPS hanging at various points until input is received due to a blocking
poll of stdin.

The patch is a backport of uClibc commit fd355bc1dbcb (eventfd.h: Use
new "bits/" scheme for arch-specific flags). The only conflict was minor
in Makefile.in.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>