diff options
author | 2024-02-22 20:21:35 +0100 | |
---|---|---|
committer | 2024-03-01 12:05:42 -0500 | |
commit | cf1d8825dd74db410aca630202e62d0e0ad5169e (patch) | |
tree | 4865a77f45702d84df68ccc5f374b1ecb6925b0a /Makefile | |
parent | Makefile: use sepolgen-ifgen-attr-helper from test toolchain (diff) | |
download | hardened-refpolicy-cf1d8825dd74db410aca630202e62d0e0ad5169e.tar.gz hardened-refpolicy-cf1d8825dd74db410aca630202e62d0e0ad5169e.tar.bz2 hardened-refpolicy-cf1d8825dd74db410aca630202e62d0e0ad5169e.zip |
Makefile: set PYTHONPATH for test toolchain
In case of a non-default toolchain also set the environment variable
PTYHONPATH to run sepolgen related python code from that toolchain.
See scripts/env_use_destdir in the SELinux userland repository.
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Signed-off-by: Kenton Groombridge <concord@gentoo.org>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -47,9 +47,16 @@ endif BINDIR ?= /usr/bin SBINDIR ?= /usr/sbin ifdef TEST_TOOLCHAIN -tc_usrbindir := env LD_LIBRARY_PATH="$(TEST_TOOLCHAIN)/lib:$(TEST_TOOLCHAIN)/usr/lib" $(TEST_TOOLCHAIN)$(BINDIR) -tc_usrsbindir := env LD_LIBRARY_PATH="$(TEST_TOOLCHAIN)/lib:$(TEST_TOOLCHAIN)/usr/lib" $(TEST_TOOLCHAIN)$(SBINDIR) -tc_sbindir := env LD_LIBRARY_PATH="$(TEST_TOOLCHAIN)/lib:$(TEST_TOOLCHAIN)/usr/lib" $(TEST_TOOLCHAIN)/sbin +python_path_plat := $(shell python3 -c "import sysconfig; print(sysconfig.get_path('platlib', vars={'platbase': '/usr', 'base': '/usr'}))") +python_path_pure := $(shell python3 -c "import sysconfig; print(sysconfig.get_path('purelib', vars={'platbase': '/usr', 'base': '/usr'}))") +ifdef PYTHONPATH +python_path := "$(TEST_TOOLCHAIN)$(python_path_plat):$(TEST_TOOLCHAIN)$(python_path_pure):$(PYTHONPATH)" +else +python_path := "$(TEST_TOOLCHAIN)$(python_path_plat):$(TEST_TOOLCHAIN)$(python_path_pure)" +endif +tc_usrbindir := env LD_LIBRARY_PATH="$(TEST_TOOLCHAIN)/lib:$(TEST_TOOLCHAIN)/usr/lib" PYTHONPATH="$(python_path)" $(TEST_TOOLCHAIN)$(BINDIR) +tc_usrsbindir := env LD_LIBRARY_PATH="$(TEST_TOOLCHAIN)/lib:$(TEST_TOOLCHAIN)/usr/lib" PYTHONPATH="$(python_path)" $(TEST_TOOLCHAIN)$(SBINDIR) +tc_sbindir := env LD_LIBRARY_PATH="$(TEST_TOOLCHAIN)/lib:$(TEST_TOOLCHAIN)/usr/lib" PYTHONPATH="$(python_path)" $(TEST_TOOLCHAIN)/sbin else tc_usrbindir := $(BINDIR) tc_usrsbindir := $(SBINDIR) |