]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
try python-config --ldflags --embed first
authorRyan Carsten Schmidt <git@ryandesign.com>
Thu, 25 Apr 2024 05:35:08 +0000 (05:35 +0000)
committerMiroslav Lichvar <mlichvar@redhat.com>
Mon, 6 May 2024 09:12:25 +0000 (11:12 +0200)
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

index 6b44233e1dfd9332c47974d7d61dc7319f5b1103..2133c3f53af2acec01e8c6d64289595d08a11867 100644 (file)
@@ -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); \