说明:集中 LinuxCNC 源码清单与 wasm/native probe 的路径解析,补强 manifest、shim、source-link 检查,并保持 LinuxCNC 源码后端对齐验证流程可复用。 验证:./test-native.sh;./test-linuxcnc-source-link.sh;./test-all-native.sh;wasm source/probe 相关脚本。
46 lines
1.2 KiB
Bash
Executable File
46 lines
1.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
linuxcnc_root=${LINUXCNC_ROOT:-../linuxcnc}
|
|
manifest=${1:-linuxcnc-rs274-wasm-source-files.txt}
|
|
cxx=${CXX:-g++}
|
|
|
|
if [[ ! -f "$manifest" ]]; then
|
|
echo "missing manifest: $manifest" >&2
|
|
exit 1
|
|
fi
|
|
|
|
if [[ ! -d "$linuxcnc_root" ]]; then
|
|
echo "missing LinuxCNC root: $linuxcnc_root" >&2
|
|
exit 1
|
|
fi
|
|
|
|
common_flags=(
|
|
-std=c++20
|
|
-DULAPI
|
|
-fsyntax-only
|
|
-include wctype.h
|
|
-I "$(pwd)/core/include"
|
|
-I "$(pwd)/core/src"
|
|
-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"
|
|
)
|
|
|
|
source_list=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_linuxcnc_wasm_source_syntax_sources.XXXXXX.txt")
|
|
trap 'rm -f "$source_list"' EXIT
|
|
LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-wasm-manifest-sources.sh "$manifest" core full > "$source_list"
|
|
mapfile -t sources < "$source_list"
|
|
|
|
for source in "${sources[@]}"; do
|
|
"$cxx" "${common_flags[@]}" "$source"
|
|
done
|
|
|
|
echo "linuxcnc wasm-safe source syntax probe passed (${#sources[@]} files)"
|