summaryrefslogtreecommitdiffstats
path: root/Misc/python-config.in
diff options
context:
space:
mode:
Diffstat (limited to 'Misc/python-config.in')
-rw-r--r--Misc/python-config.in12
1 files changed, 9 insertions, 3 deletions
diff --git a/Misc/python-config.in b/Misc/python-config.in
index 1df30d2..727c4a8 100644
--- a/Misc/python-config.in
+++ b/Misc/python-config.in
@@ -9,7 +9,8 @@ import sys
import sysconfig
valid_opts = ['prefix', 'exec-prefix', 'includes', 'libs', 'cflags',
- 'ldflags', 'extension-suffix', 'help', 'abiflags', 'configdir']
+ 'ldflags', 'extension-suffix', 'help', 'abiflags', 'configdir',
+ 'embed']
def exit_with_usage(code=1):
print("Usage: {0} [{1}]".format(
@@ -47,8 +48,13 @@ for opt in opt_flags:
print(' '.join(flags))
elif opt in ('--libs', '--ldflags'):
- libpython = getvar('LIBPYTHON')
- libs = [libpython] if libpython else []
+ libs = []
+ if '--embed' in opt_flags:
+ libs.append('-lpython' + pyver + sys.abiflags)
+ else:
+ libpython = getvar('LIBPYTHON')
+ if libpython:
+ libs.append(libpython)
libs.extend(getvar('LIBS').split() + getvar('SYSLIBS').split())
# add the prefix/lib/pythonX.Y/config dir, but only if there is no