|
15 | 15 | from build.env import DefaultIsolatedEnv
|
16 | 16 | from packaging.requirements import Requirement
|
17 | 17 |
|
18 |
| -from . import common, pywasmcross |
| 18 | +from . import _f2c_fixes, common, pywasmcross |
19 | 19 | from .build_env import (
|
20 | 20 | get_build_flag,
|
21 | 21 | get_hostsitepackages,
|
@@ -214,10 +214,20 @@ def make_command_wrapper_symlinks(symlink_dir: Path) -> dict[str, str]:
|
214 | 214 | The dictionary of compiler environment variables that points to the symlinks.
|
215 | 215 | """
|
216 | 216 |
|
| 217 | + # For maintainers: |
| 218 | + # - you can set "_f2c_fixes_wrapper" variable in pyproject.toml |
| 219 | + # in order to change the script to use when cross-compiling |
| 220 | + # this is only for maintainers and *should* not be used by others |
| 221 | + |
217 | 222 | pywasmcross_exe = symlink_dir / "pywasmcross.py"
|
218 |
| - shutil.copy2(pywasmcross.__file__, pywasmcross_exe) |
| 223 | + pywasmcross_origin = pywasmcross.__file__ |
| 224 | + shutil.copy2(pywasmcross_origin, pywasmcross_exe) |
219 | 225 | pywasmcross_exe.chmod(0o755)
|
220 | 226 |
|
| 227 | + f2c_fixes_exe = symlink_dir / "_f2c_fixes.py" |
| 228 | + f2c_fixes_origin = get_build_flag("_F2C_FIXES_WRAPPER") or _f2c_fixes.__file__ |
| 229 | + shutil.copy2(f2c_fixes_origin, f2c_fixes_exe) |
| 230 | + |
221 | 231 | env = {}
|
222 | 232 | for symlink in pywasmcross.SYMLINKS:
|
223 | 233 | symlink_path = symlink_dir / symlink
|
@@ -266,7 +276,7 @@ def get_build_env(
|
266 | 276 | env.update(make_command_wrapper_symlinks(symlink_dir))
|
267 | 277 |
|
268 | 278 | sysconfig_dir = Path(get_build_flag("TARGETINSTALLDIR")) / "sysconfigdata"
|
269 |
| - args["PYTHONPATH"] = sys.path + [str(sysconfig_dir)] |
| 279 | + args["PYTHONPATH"] = sys.path + [str(symlink_dir), str(sysconfig_dir)] |
270 | 280 | args["orig__name__"] = __name__
|
271 | 281 | args["pythoninclude"] = get_build_flag("PYTHONINCLUDE")
|
272 | 282 | args["PATH"] = env["PATH"]
|
|
0 commit comments