• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) Hisilicon Technologies Co., Ltd. 2021-2022. All rights reserved.
2#!/bin/sh
3
4function cancel_opt
5{
6    pattern=$1
7    sed -i "s/$pattern 1/$pattern 0/g" config.h
8    sed -i "s/$pattern/!$pattern/g" ffbuild/config.mak
9}
10
11function effect_opt
12{
13    pattern=$1
14    echo $pattern
15    sed -i "s/$pattern 0/$pattern 1/g" config.h
16    sed -i "s/!$pattern/$pattern/g" ffbuild/config.mak
17}
18
19function adapt_liteos
20{
21echo "adapt ffmpeg for liteos"
22
23sed -i "/^CFLAGS=/ s/$/ \$(LITEOS_MACRO) \$(LITEOS_OSDRV_INCLUDE) \$(LITEOS_USR_INCLUDE) \$(LITEOS_CMACRO) \$(LITEOS_INCLUDE) \-I\$(LITEOSTOPDIR)\/lib\/cxxstl\/gccinclude/g" ffbuild/config.mak
24
25sed -i "s:atomics\/gcc:atomics\/pthread:g" ffbuild/config.mak
26
27sed -i "/getenv/ s:^://:g" config.h
28
29effect_opt HAVE_UNISTD_H
30effect_opt HAVE_CBRT
31effect_opt HAVE_CBRTF
32effect_opt HAVE_COPYSIGN
33effect_opt HAVE_ERF
34effect_opt HAVE_HYPOT
35effect_opt HAVE_RINT
36effect_opt HAVE_LRINT
37effect_opt HAVE_LRINTF
38effect_opt HAVE_ROUND
39effect_opt HAVE_ROUNDF
40effect_opt HAVE_TRUNC
41effect_opt HAVE_TRUNCF
42effect_opt HAVE_GMTIME_R
43effect_opt HAVE_LOCALTIME_R
44effect_opt HAVE_PTHREAD_CANCEL
45effect_opt HAVE_PTHREADS
46effect_opt HAVE_SIMD_ALIGN_16
47
48cancel_opt HAVE_SYSCONF
49cancel_opt HAVE_SYSCTL
50cancel_opt HAVE_ATOMICS_NATIVE
51cancel_opt HAVE_LLRINTF
52cancel_opt HAVE_MMAP
53cancel_opt HAVE_LZO1X_999_COMPRESS
54cancel_opt HAVE_GETHRTIME
55cancel_opt HAVE_CABS
56cancel_opt HAVE_CEXP
57cancel_opt HAVE_VALGRIND_VALGRIND_H
58cancel_opt HAVE_SYMVER_ASM_LABEL
59#cancel_opt CONFIG_MANPAGES
60#cancel_opt CONFIG_PODPAGES
61#cancel_opt CONFIG_FAAN
62#cancel_opt CONFIG_FAANDCT
63#cancel_opt CONFIG_FAANIDCT
64#cancel_opt CONFIG_FDCTDSP
65
66make clean
67
68echo "already adapt ffmpeg to liteos"
69}
70CURDIR=$(pwd)
71adapt_liteos
72