0d64a97
diff --git a/third_party/waf/waflib/Tools/python.py b/third_party/waf/waflib/Tools/python.py
0d64a97
index 52a05c6..79836bb 100644
0d64a97
--- a/third_party/waf/waflib/Tools/python.py
0d64a97
+++ b/third_party/waf/waflib/Tools/python.py
0d64a97
@@ -338,7 +338,11 @@ def check_python_headers(conf, features='pyembed pyext'):
0d64a97
 
0d64a97
 		if 'pyembed' in features:
0d64a97
 			for flags in all_flags:
0d64a97
-				conf.check_cfg(msg='Asking python-config for pyembed %r flags' % ' '.join(flags), path=env.PYTHON_CONFIG, package='', uselib_store='PYEMBED', args=flags)
0d64a97
+				embedflags = flags + ['--embed']
0d64a97
+				try:
0d64a97
+					conf.check_cfg(msg='Asking python-config for pyembed %r flags' % ' '.join(embedflags), path=env.PYTHON_CONFIG, package='', uselib_store='PYEMBED', args=embedflags)
0d64a97
+				except conf.errors.ConfigurationError:
0d64a97
+					conf.check_cfg(msg='Asking python-config for pyembed %r flags' % ' '.join(flags), path=env.PYTHON_CONFIG, package='', uselib_store='PYEMBED', args=flags)
0d64a97
 
0d64a97
 			try:
0d64a97
 				conf.test_pyembed(xx)