--- ./Misc/python-config.in_orig	2026-07-14 02:23:56.450582687 -0400
+++ ./Misc/python-config.in	2026-07-14 02:33:22.969370098 -0400
@@ -49,19 +49,14 @@
 
     elif opt in ('--libs', '--ldflags'):
         libs = []
-        if '--embed' in opt_flags:
-            libs.append('-lpython' + pyver + sys.abiflags)
-        else:
-            libpython = getvar('LIBPYTHON')
-            if libpython:
-                libs.append(libpython)
+        libs.append('-lpython' + pyver + sys.abiflags)
         libs.extend(getvar('LIBS').split() + getvar('SYSLIBS').split())
 
         # add the prefix/lib/pythonX.Y/config dir, but only if there is no
         # shared library in prefix/lib/.
         if opt == '--ldflags':
-            if not getvar('Py_ENABLE_SHARED'):
-                libs.insert(0, '-L' + getvar('LIBPL'))
+            if getvar('Py_ENABLE_SHARED') and sys.platform.startswith('aix'):
+                libs.insert(0, '-L' + getvar('LIBDIR'))
         print(' '.join(libs))
 
     elif opt == '--extension-suffix':
--- ./Misc/python-config.sh.in_orig	2026-07-14 02:24:02.765646857 -0400
+++ ./Misc/python-config.sh.in	2026-07-14 02:26:29.381256567 -0400
@@ -47,7 +47,7 @@
 LIBC="@LIBC@"
 SYSLIBS="$LIBM $LIBC"
 ABIFLAGS="@ABIFLAGS@"
-LIBS="@LIBPYTHON@ @LIBS@ $SYSLIBS"
+LIBS="-lpython${VERSION}${ABIFLAGS} @LIBS@ $SYSLIBS"
 LIBS_EMBED="-lpython${VERSION}${ABIFLAGS} @LIBS@ $SYSLIBS"
 BASECFLAGS="@BASECFLAGS@"
 LDLIBRARY="@LDLIBRARY@"
--- ./Misc/python.pc.in_orig	2026-07-21 01:10:04.669948508 -0400
+++ ./Misc/python.pc.in	2026-07-21 01:10:59.540743028 -0400
@@ -9,5 +9,5 @@
 Requires:
 Version: @VERSION@
 Libs.private: @LIBS@
-Libs: -L${libdir} @LIBPYTHON@
+Libs: -L${libdir} -lpython@VERSION@@ABIFLAGS@
 Cflags: -I${includedir}/python@VERSION@@ABIFLAGS@
