# Check that all symbols exported by libpython start with "Py" or "_Py"
smelly: @DEF_MAKE_RULE@
- $(RUNSHARED) ./$(BUILDPYTHON) Tools/scripts/smelly.py
+ $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/smelly.py
# Find files with funny names
funny:
def check_extensions():
print(__file__)
- srcdir = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
- filename = os.path.join(srcdir, "pybuilddir.txt")
+ # This assumes pybuilddir.txt is in same directory as pyconfig.h.
+ # In the case of out-of-tree builds, we can't assume pybuilddir.txt is
+ # in the source folder.
+ config_dir = os.path.dirname(sysconfig.get_config_h_filename())
+ filename = os.path.join(config_dir, "pybuilddir.txt")
try:
with open(filename, encoding="utf-8") as fp:
pybuilddir = fp.readline()
return True
print(f"Check extension modules from {pybuilddir} directory")
- builddir = os.path.join(srcdir, pybuilddir)
+ builddir = os.path.join(config_dir, pybuilddir)
nsymbol = 0
for name in os.listdir(builddir):
if not name.endswith(".so"):