btrfs-progs: build: Pass CFLAGS and LDFLAGS to Python

Adds Make variables EXTRA_PYTHON_CFLAGS and EXTRA_PYTHON_LDFLAGS which
can be used to pass CFLAGS and LDFLAGS respectively when building the
Python library.

This is required to support reproducible builds, as there are often
compiler and linker flags that must be passed in order to generate
reproducible output (e.g. -fdebug-prefix-map)

Pull-request: #176
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Joshua Watt 2019-05-26 21:26:04 -05:00 committed by David Sterba
parent 43013422db
commit 66cb960705
1 changed files with 5 additions and 1 deletions

View File

@ -24,6 +24,10 @@
# DEBUG_CFLAGS additional compiler flags for debugging build
# EXTRA_CFLAGS additional compiler flags
# EXTRA_LDFLAGS additional linker flags
# EXTRA_PYTHON_CFLAGS additional compiler flags to pass when building Python
# library
# EXTRA_PYTHON_LDFLAGS additional linker flags to pass when building Python
# library
#
# Testing-specific options (see also tests/README.md):
# TEST=GLOB run test(s) from directories matching GLOB
@ -439,7 +443,7 @@ ifeq ($(PYTHON_BINDINGS),1)
libbtrfsutil_python: libbtrfsutil.so.$(libbtrfsutil_major) libbtrfsutil.so libbtrfsutil/btrfsutil.h
@echo " [PY] libbtrfsutil"
$(Q)cd libbtrfsutil/python; \
CFLAGS= LDFLAGS= $(PYTHON) setup.py $(SETUP_PY_Q) build_ext -i build
CFLAGS="$(EXTRA_PYTHON_CFLAGS)" LDFLAGS="$(EXTRA_PYTHON_LDFLAGS)" $(PYTHON) setup.py $(SETUP_PY_Q) build_ext -i build
.PHONY: libbtrfsutil_python
endif