File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -228,8 +228,17 @@ strip-libs = $(filter-out -l%,$(1))
228
228
229
229
PYTHON_CONFIG_SQ := $(call shell-sq,$(PYTHON_CONFIG))
230
230
231
+ # Python 3.8 changed the output of `python-config --ldflags` to not include the
232
+ # '-lpythonX.Y' flag unless '--embed' is also passed. The feature check for
233
+ # libpython fails if that flag is not included in LDFLAGS
234
+ ifeq ($(shell $(PYTHON_CONFIG_SQ) --ldflags --embed 2>&1 1>/dev/null; echo $$?), 0)
235
+ PYTHON_CONFIG_LDFLAGS := --ldflags --embed
236
+ else
237
+ PYTHON_CONFIG_LDFLAGS := --ldflags
238
+ endif
239
+
231
240
ifdef PYTHON_CONFIG
232
- PYTHON_EMBED_LDOPTS := $(shell $(PYTHON_CONFIG_SQ) --ldflags 2>/dev/null)
241
+ PYTHON_EMBED_LDOPTS := $(shell $(PYTHON_CONFIG_SQ) $(PYTHON_CONFIG_LDFLAGS) 2>/dev/null)
233
242
PYTHON_EMBED_LDFLAGS := $(call strip-libs,$(PYTHON_EMBED_LDOPTS))
234
243
PYTHON_EMBED_LIBADD := $(call grep-libs,$(PYTHON_EMBED_LDOPTS)) -lutil
235
244
PYTHON_EMBED_CCOPTS := $(shell $(PYTHON_CONFIG_SQ) --includes 2>/dev/null)
You can’t perform that action at this time.
0 commit comments