Files
build_infra/linux_shell/build_script2/gcc/辅助脚本/python_gdb.bash
T
psc d777714fd1 放弃 linux交叉windows 编译clang
因为 llvm clang源码cmakelist 不支持 里面汇编也不支持
2026-07-01 15:39:11 +08:00

40 lines
1.0 KiB
Bash

#!/usr/bin/env bash
set -euo pipefail
# 此脚本用于 binutils-gdb 在host是windows系统的时候 使用的 单独添加选项 --with-python=/ae/sysroots/mingw64/python_gdb.bash 即可使用
# C:\msys64
# C:\msys64\var\cache\pacman\pkg 存放下载安装好的mingw包
# C:\msys64\mingw64 是系统根目录
root="/ae/sysroots/mingw64"
lib="${root}/lib"
include="${root}/include"
case "${2:-${1:-}}" in
--includes|--cflags)
printf '%s\n' "-I${include}/python3.12"
;;
--ldflags|--libs)
if [ -f "${lib}/libpython3.12.dll.a" ]; then
printf '%s\n' "${lib}/libpython3.12.dll.a"
elif [ -f "${lib}/libpython3.dll.a" ]; then
printf '%s\n' "${lib}/libpython3.dll.a"
elif [ -f "${lib}/libpython3.12.a" ]; then
printf '%s\n' "${lib}/libpython3.12.a"
elif [ -f "${lib}/libpython3.a" ]; then
printf '%s\n' "${lib}/libpython3.a"
else
echo "no usable libpython found in ${lib}" >&2
exit 1
fi
;;
--exec-prefix)
printf '%s\n' "${root}"
;;
*)
echo "unsupported args: $*" >&2
exit 1
;;
esac