Go to file
Adam Duskett 2158c87206 package/pkg-python: use a shell expansion for sysconfigdata_name
Currently, GNU Make expands the Python SYSCONFIGDATA_NAME variable;
however, when building with per-package directories, this variable is
not set because the evaluation of this variable occurs before buildroot
creates the per-package directories of a given package.

This can be easily demonstrated with that trivial Makefile:

    $ cat Makefile
    BLA = $(wildcard bla)
    all:
        @echo 'BLA=$(BLA)'
        @touch bla
        @echo 'BLA=$(BLA)'

    $ make
    BLA=
    BLA=

    $ make
    BLA=bla
    BLA=bla

I.e. the variables are evaluated at the beginning of a recipe, not for
each line of the recipe.

There are two solutions to fix this problem:

  - add a step between "patch" and "configure," which would evaluate all
    of the variables after creating the per-package directories;

  - evaluate SYSCONFIGDATA_NAME via a shell expansion instead of
    Makefile, to postpone the effective ex[ansion to until after the
    file has been created.

Even though the first option is semantically the best solution, this is
also very intrusive, especially since python3 is so far the only case
where we would need it. The second option however is more expedient, adn
so this is what we're doing here.

We introduce PKG_PYTHON_SYSCONFIGDATA_PATH to avoid duplication and to
make the following line easier to read.

Then PKG_PYTHON_SYSCONFIGDATA_NAME is actually defined as a back-tick
shell expansion (although back-ticks have their drawbacks, using $(...)
in Makefile is not trivial either):

  - we test that the file does exist, to cover the python2 and python3
    cases: with python2, the file does not exist, so we want to expand
    to an empty string; 'basename' only works on the filename, and does
    not check the file actually exists;

  - if the file exist, we get its basename without the .py extension,
    and this makes our expansion;

  - the "|| true" is added to ensure the old behavior of returning an
    empty string if the file does not exist still works, when the
    expansion is attempted in a shell where 'set -e' is in effect (the
    test would fail with python2, but this is not an error).

Fixes: https://bugs.busybox.net/show_bug.cgi?id=12941
Signed-off-by: Adam Duskett <Aduskett@gmail.com>
[yann.morin.1998@free.fr: slight rewording in commit log]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-06-15 22:58:41 +02:00
arch arch/x86: adds BR2_X86_CPU_HAS_3DNOW flag 2020-05-15 21:47:50 +02:00
board Merge branch 'next' 2020-06-02 21:59:52 +02:00
boot boot/grub2: Fix GRUB i386-pc build with Ubuntu gcc 2020-06-05 00:03:30 +02:00
configs configs/orangepi_zero_defconfig: use python 3.x 2020-06-15 11:37:12 +02:00
docs docs/manual/adding-packages-generic.txt: fix typo 2020-06-06 21:28:31 +02:00
fs fs/ubi: expose BINARIES_DIR to ubinize.cfg 2020-06-06 13:43:43 +02:00
linux {linux, linux-headers}: bump 4.{4, 9, 14, 19}.x / 5.{4, 6, 7}.x series 2020-06-07 21:58:04 +02:00
package package/pkg-python: use a shell expansion for sysconfigdata_name 2020-06-15 22:58:41 +02:00
support core/br2-external: report better error messages 2020-06-15 11:01:54 +02:00
system
toolchain toolchain: adjust version check to allow for single numbers 2020-06-14 22:11:06 +02:00
utils
.defconfig
.flake8
.gitignore
.gitlab-ci.yml gitlab-ci: regenerate after freescale_imx8mnevk_defconfig addition 2020-06-07 09:00:51 +02:00
.gitlab-ci.yml.in gitlab.yml.in*: enable Qemu gitlab testing 2020-04-13 21:51:13 +02:00
CHANGES Update for 2020.02.3 2020-06-04 11:10:45 +02:00
Config.in
Config.in.legacy package/kodi-peripheral-steamcontroller: remove package 2020-06-14 10:25:41 +02:00
COPYING
DEVELOPERS package/earlyoom: new package 2020-06-14 16:53:13 +02:00
Makefile Kickoff 2020.08 cycle 2020-06-01 23:32:11 +02:00
Makefile.legacy
README

Buildroot is a simple, efficient and easy-to-use tool to generate embedded
Linux systems through cross-compilation.

The documentation can be found in docs/manual. You can generate a text
document with 'make manual-text' and read output/docs/manual/manual.text.
Online documentation can be found at http://buildroot.org/docs.html

To build and use the buildroot stuff, do the following:

1) run 'make menuconfig'
2) select the target architecture and the packages you wish to compile
3) run 'make'
4) wait while it compiles
5) find the kernel, bootloader, root filesystem, etc. in output/images

You do not need to be root to build or run buildroot.  Have fun!

Buildroot comes with a basic configuration for a number of boards. Run
'make list-defconfigs' to view the list of provided configurations.

Please feed suggestions, bug reports, insults, and bribes back to the
buildroot mailing list: buildroot@buildroot.org
You can also find us on #buildroot on Freenode IRC.

If you would like to contribute patches, please read
https://buildroot.org/manual.html#submitting-patches