说明:集中 LinuxCNC 源码清单与 wasm/native probe 的路径解析,补强 manifest、shim、source-link 检查,并保持 LinuxCNC 源码后端对齐验证流程可复用。 验证:./test-native.sh;./test-linuxcnc-source-link.sh;./test-all-native.sh;wasm source/probe 相关脚本。
38 lines
962 B
Bash
Executable File
38 lines
962 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
linuxcnc_root=${LINUXCNC_ROOT:-../linuxcnc}
|
|
cxx=${CXX:-g++}
|
|
build_dir=$(mktemp -d "${TMPDIR:-/tmp}/cnc_sim_linuxcnc_wasm_python_plugin_link.XXXXXX")
|
|
|
|
if [[ ! -d "$linuxcnc_root" ]]; then
|
|
echo "missing LinuxCNC root: $linuxcnc_root" >&2
|
|
exit 1
|
|
fi
|
|
trap 'rm -rf "$build_dir"' EXIT
|
|
|
|
python_plugin_shim=$(./list-linuxcnc-wasm-safe-shims.sh python_plugin.cc)
|
|
|
|
common_flags=(
|
|
-std=c++17
|
|
-DULAPI
|
|
-I "$(pwd)/core/wasm_shims"
|
|
-I "$linuxcnc_root/src"
|
|
-I "$linuxcnc_root/src/emc"
|
|
-I "$linuxcnc_root/src/emc/nml_intf"
|
|
-I "$linuxcnc_root/src/emc/rs274ngc"
|
|
-I "$linuxcnc_root/src/emc/motion"
|
|
-I "$linuxcnc_root/include"
|
|
)
|
|
|
|
"$cxx" "${common_flags[@]}" \
|
|
"$python_plugin_shim" \
|
|
core/wasm_shims/pythonplugin/python_plugin_probe_main.cc \
|
|
-o "$build_dir/python_plugin_probe"
|
|
|
|
"$build_dir/python_plugin_probe"
|
|
|
|
echo "linuxcnc wasm python_plugin link probe passed"
|