Files
wasm-simulator/list-linuxcnc-wasm-common-cxxflags.sh
cnc b40914747d 满庭芳·源流归一
结论: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。
2026-05-28 18:00:53 +08:00

118 lines
2.8 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")"
linuxcnc_root=${LINUXCNC_ROOT:-../linuxcnc}
std_flag=-std=c++17
include_core_include=0
include_core_src=0
include_tooldata=0
include_wctype=0
syntax_only=0
function_sections=0
data_sections=0
profile=base
while [[ "$#" -gt 0 ]]; do
case "$1" in
--profile)
if [[ "$#" -lt 2 ]]; then
echo "missing --profile value" >&2
exit 1
fi
profile=$2
shift 2
;;
--std)
if [[ "$#" -lt 2 ]]; then
echo "missing --std value" >&2
exit 1
fi
std_flag=-std="$2"
shift 2
;;
--core-include)
include_core_include=1
shift
;;
--core-src)
include_core_src=1
shift
;;
--tooldata-include)
include_tooldata=1
shift
;;
--wctype)
include_wctype=1
shift
;;
--syntax-only)
syntax_only=1
shift
;;
--function-sections)
function_sections=1
shift
;;
--data-sections)
data_sections=1
shift
;;
--)
shift
break
;;
*)
echo "unknown wasm cxxflag option: $1" >&2
exit 1
;;
esac
done
case "$profile" in
base|core20|core20-sections)
;;
*)
echo "unknown wasm cxxflag profile: $profile" >&2
exit 1
;;
esac
case "$profile" in
core20|core20-sections)
std_flag=-std=c++20
include_core_include=1
include_core_src=1
include_wctype=1
;;
esac
case "$profile" in
core20-sections)
function_sections=1
data_sections=1
;;
esac
LINUXCNC_ROOT="$linuxcnc_root" ./check-linuxcnc-inputs.sh --root-only
printf '%s\n' \
"$std_flag" \
-DULAPI \
$([[ "$syntax_only" -eq 1 ]] && printf '%s\n' -fsyntax-only) \
$([[ "$include_wctype" -eq 1 ]] && printf '%s\n' -include wctype.h) \
$([[ "$function_sections" -eq 1 ]] && printf '%s\n' -ffunction-sections) \
$([[ "$data_sections" -eq 1 ]] && printf '%s\n' -fdata-sections) \
$([[ "$include_core_include" -eq 1 ]] && printf '%s\n' -I "$(pwd)/core/include") \
$([[ "$include_core_src" -eq 1 ]] && printf '%s\n' -I "$(pwd)/core/src") \
$([[ "$include_tooldata" -eq 1 ]] && printf '%s\n' -I "$linuxcnc_root/src/emc/tooldata") \
-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"