From 838807a82a400eb3bd086da2632dcc830a6d8319 Mon Sep 17 00:00:00 2001 From: Ryan Carsten Schmidt Date: Thu, 25 Apr 2024 05:35:08 +0000 Subject: [PATCH] try python-config --ldflags --embed first As of python 3.8, output of "python-config --ldflags" no longer includes the "-lpython" flag without which the python module fails to link due to undefined symbols. Use "python-config --ldflags --embed" to get it back and fall back to "python-config --ldflags" for python 3.7 and older. https://docs.python.org/3.8/whatsnew/3.8.html#debug-build-uses-the-same-abi-as-release-build --- Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index 6b44233..2133c3f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -92,7 +92,7 @@ _snack.$(SOEXT): snack.c $(LIBNEWTSH) fi; \ mkdir -p $$ver; \ PCFLAGS=`$$pyconfig --cflags`; \ - PLDFLAGS=`$$pyconfig --ldflags`; \ + PLDFLAGS=`$$pyconfig --ldflags --embed || $$pyconfig --ldflags`; \ echo $(CC) $(SHCFLAGS) $(CFLAGS) $(CPPFLAGS) $$PCFLAGS -c -o $$ver/snack.o snack.c; \ $(CC) $(SHCFLAGS) $(CFLAGS) $(CPPFLAGS) $$PCFLAGS -c -o $$ver/snack.o snack.c; \ echo $(CC) --shared $(LDFLAGS) $$PLDFLAGS -o $$ver/_snack.$(SOEXT) $$ver/snack.o -L. -lnewt $(LIBS); \ -- 2.47.2