1 Star 0 Fork 0

LJH/ljh-libdrm

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
build.sh 2.04 KB
一键复制 编辑 原始数据 按行查看 历史
lu_jianhui 提交于 2024-02-26 11:17 . add
#!/bin/bash
set -e
set -x
CURRENT_ROOT_PATH=`dirname "$PWD"`
OHOS_SDK_PATH=$CURRENT_ROOT_PATH/ohos-sdk
prefix_path=$CURRENT_ROOT_PATH/ffmpeg/out
OUTPUT=$CURRENT_ROOT_PATH/ffmpeg/out
LLVM=$OHOS_SDK_PATH/llvm
SYSROOT=$OHOS_SDK_PATH/sysroot
NINJA_PATH=$OHOS_SDK_PATH/ninja
CPU=aarch64
CC=$LLVM/bin/$CPU-linux-ohos-clang
CXX=$LLVM/bin/$CPU-linux-ohos-clang++
STRIP=$LLVM/bin/llvm-strip
LD=$LLVM/bin/$CPU-linux-ohos-clang
OPTIMIZE_CFLAGS="-march=$CPU"
HOST_CC=$LLVM/bin/$CPU-linux-ohos-clang
HOST_LD=$LLVM/bin/$CPU-linux-ohos-clang
HOST_LD_FLAG=-L$SYSROOT/usr/lib/$CPU-linux-ohos
if [ -d _build ];then
rm -r _build
fi
mkdir _build
if [ -d _bin ];then
rm -r _bin
fi
mkdir _bin
#创建交叉编译配置文件cross_file.txt
#还可设置c_args等等类似 CFLAGS
echo "[constants]" > cross_file.txt
echo "arch = '${LLVM}'" >> cross_file.txt
echo "[binaries]" >> cross_file.txt
echo "c = '${CC}'" >> cross_file.txt
echo "cpp = '${CXX}'" >> cross_file.txt
#echo "ar = '${CC}'" >> cross_file.txt
echo "ld = '${LD}'" >> cross_file.txt
echo "srtip = '${STRIP}'" >> cross_file.txt
echo "sys_root = '${SYSROOT}'" >> cross_file.txt
#echo "pkg_config_libdir = '${sys_root}/usr/lib/pkgconfig'" >> cross_file.txt
#编译结果可运行平台的架构
echo "[host_machine]" >> cross_file.txt
echo "system = 'linux'" >> cross_file.txt
echo "cpu_family = 'aarch64'" >> cross_file.txt
echo "cpu = 'aarch64'" >> cross_file.txt
echo "endian = 'little'" >> cross_file.txt
#类似于configure功能 meson configure 获取到可配置项
echo "[project options]" >> cross_file.txt
#编译libkms,选项可以参考meson.build及meson_option.txt
echo "libkms = 'true'" >> cross_file.txt
#安装测试程序(kmstest/modetest等)到_bin/bin/目录下
echo "install-test-programs = 'true'" >> cross_file.txt
#类似于执行configure
meson setup _build --prefix=${prefix_path} --cross-file cross_file.txt
cd _build
chmod 777 ${NINJA_PATH}/*
#编译 类似于make
${NINJA_PATH}/ninja
#类似于make install, *.h *.a *.so install to prefix dir
${NINJA_PATH}/ninja install
cd ../
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/lu_jianhui/ljh-libdrm.git
git@gitee.com:lu_jianhui/ljh-libdrm.git
lu_jianhui
ljh-libdrm
ljh-libdrm
master

搜索帮助