高效率推进 LinuxCNC 源码对齐流程
说明:集中 LinuxCNC 源码清单与 wasm/native probe 的路径解析,补强 manifest、shim、source-link 检查,并保持 LinuxCNC 源码后端对齐验证流程可复用。 验证:./test-native.sh;./test-linuxcnc-source-link.sh;./test-all-native.sh;wasm source/probe 相关脚本。
This commit is contained in:
@@ -7,17 +7,6 @@ linuxcnc_root=${LINUXCNC_ROOT:-../linuxcnc}
|
||||
manifest=${1:-linuxcnc-rs274-wasm-source-files.txt}
|
||||
cxx=${CXX:-g++}
|
||||
build_dir=$(mktemp -d "${TMPDIR:-/tmp}/cnc_sim_linuxcnc_wasm_safe_probe.XXXXXX")
|
||||
shim_sources=(
|
||||
core/wasm_shims/dlfcn.cc
|
||||
core/wasm_shims/emc_status_shim.cc
|
||||
core/wasm_shims/gettext_shim.cc
|
||||
core/wasm_shims/linuxcnc_runtime_shim.cc
|
||||
core/wasm_shims/python_c_api_shim.cc
|
||||
core/wasm_shims/rtapi_compat.cc
|
||||
core/wasm_shims/tooldata/tooldata_mmap_backend.cc
|
||||
core/wasm_shims/tooldata/tooldata_runtime_stubs.cc
|
||||
core/wasm_shims/pythonplugin/python_plugin.cc
|
||||
)
|
||||
|
||||
if [[ ! -f "$manifest" ]]; then
|
||||
echo "missing manifest: $manifest" >&2
|
||||
@@ -30,6 +19,10 @@ if [[ ! -d "$linuxcnc_root" ]]; then
|
||||
fi
|
||||
trap 'rm -rf "$build_dir"' EXIT
|
||||
|
||||
shim_list="$build_dir/wasm_safe_shims.txt"
|
||||
./list-linuxcnc-wasm-safe-shims.sh > "$shim_list"
|
||||
mapfile -t shim_sources < "$shim_list"
|
||||
|
||||
common_flags=(
|
||||
-std=c++20
|
||||
-DULAPI
|
||||
@@ -45,24 +38,9 @@ common_flags=(
|
||||
-I "$linuxcnc_root/include"
|
||||
)
|
||||
|
||||
sources=()
|
||||
while IFS=: read -r group path note; do
|
||||
case "$group" in
|
||||
core)
|
||||
if [[ ! -f "$linuxcnc_root/$path" ]]; then
|
||||
echo "missing manifest source: $path" >&2
|
||||
exit 1
|
||||
fi
|
||||
sources+=("$path")
|
||||
;;
|
||||
""|\#*|blocked)
|
||||
;;
|
||||
*)
|
||||
echo "unknown manifest group: $group" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done < "$manifest"
|
||||
source_list="$build_dir/wasm_core_sources.txt"
|
||||
LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-wasm-manifest-sources.sh "$manifest" core full > "$source_list"
|
||||
mapfile -t sources < "$source_list"
|
||||
|
||||
shim_index=0
|
||||
for source in "${shim_sources[@]}"; do
|
||||
@@ -74,7 +52,7 @@ done
|
||||
source_index=0
|
||||
for source in "${sources[@]}"; do
|
||||
obj="$build_dir/linuxcnc_${source_index}.o"
|
||||
"$cxx" "${common_flags[@]}" -c "$linuxcnc_root/$source" -o "$obj"
|
||||
"$cxx" "${common_flags[@]}" -c "$source" -o "$obj"
|
||||
source_index=$((source_index + 1))
|
||||
done
|
||||
|
||||
|
||||
Reference in New Issue
Block a user