满庭芳·源流归一
结论:LinuxCNC rs274ngc 源码移植边界继续收拢。已将 rs274ngc 头文件纳入 manifest 跟踪,core 编译组仍只包含可编译源文件;启用 CNC_SIM_ENABLE_LINUXCNC_RS274_BACKEND 时 API 默认使用 LinuxCNC rs274 后端;M428/M429/M430 与 5axis/TRT/TDR/RTCP 相关路径继续保持来自 LinuxCNC 源码或 remap 配置的薄桥接。 验证:./test-linuxcnc-source-syntax.sh;./test-linuxcnc-api-native.sh;./test-native.sh;./test-linuxcnc-source-link.sh。
This commit is contained in:
@@ -6,32 +6,35 @@ cd "$(dirname "$0")"
|
||||
linuxcnc_root=${LINUXCNC_ROOT:-../linuxcnc}
|
||||
manifest=${1:-linuxcnc-rs274-wasm-source-files.txt}
|
||||
|
||||
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
|
||||
LINUXCNC_ROOT="$linuxcnc_root" ./check-linuxcnc-inputs.sh "$manifest"
|
||||
manifest=$(cd "$(dirname "$manifest")" && pwd)/$(basename "$manifest")
|
||||
linuxcnc_root=$(cd "$linuxcnc_root" && pwd)
|
||||
default_manifest="$PWD/linuxcnc-rs274-wasm-source-files.txt"
|
||||
|
||||
count_nonempty_lines() {
|
||||
local text=${1-}
|
||||
local count=0
|
||||
local line
|
||||
|
||||
while IFS= read -r line; do
|
||||
if [[ -n "$line" ]]; then
|
||||
count=$((count + 1))
|
||||
fi
|
||||
done <<<"$text"
|
||||
|
||||
printf '%s\n' "$count"
|
||||
}
|
||||
|
||||
# This script writes fixed build and public artifact paths, so serialize it.
|
||||
exec 9>"${TMPDIR:-/tmp}/cnc_sim_build_wasm.lock"
|
||||
flock 9
|
||||
|
||||
manifest_core_count=0
|
||||
manifest_blocked_count=0
|
||||
manifest_core_sources=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_wasm_manifest_core.XXXXXX.txt")
|
||||
manifest_blocked_sources=$(mktemp "${TMPDIR:-/tmp}/cnc_sim_wasm_manifest_blocked.XXXXXX.txt")
|
||||
trap 'rm -f "$manifest_core_sources" "$manifest_blocked_sources"' EXIT
|
||||
LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-wasm-manifest-sources.sh "$manifest" core > "$manifest_core_sources"
|
||||
LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-wasm-manifest-sources.sh "$manifest" blocked > "$manifest_blocked_sources"
|
||||
manifest_core_count=$(wc -l < "$manifest_core_sources")
|
||||
manifest_blocked_count=$(wc -l < "$manifest_blocked_sources")
|
||||
manifest_core_output=$(LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-wasm-manifest-sources.sh "$manifest" core)
|
||||
manifest_blocked_output=$(LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-wasm-manifest-sources.sh "$manifest" blocked)
|
||||
manifest_core_count=$(count_nonempty_lines "$manifest_core_output")
|
||||
manifest_blocked_count=$(count_nonempty_lines "$manifest_blocked_output")
|
||||
|
||||
if [[ "$manifest_core_count" -eq 0 || "$manifest_blocked_count" -eq 0 ]]; then
|
||||
echo "unexpected wasm manifest partition: core=$manifest_core_count blocked=$manifest_blocked_count" >&2
|
||||
|
||||
Reference in New Issue
Block a user