chore: pass sysroot and arch related cflags by BUILD.gn

build should not modify files in the repository,
we made this posible now.
sysroot and arch related cflags are pass by BUILD.gn now.

Signed-off-by: Caoruihong <crh.cao@huawei.com>
Change-Id: Ib0b8a9553468dcca03e141025e7a7d8250d8f95f
This commit is contained in:
Caoruihong
2021-06-24 00:25:54 +08:00
parent 6e41c548fd
commit f7dbc78c94
8 changed files with 29 additions and 14 deletions
+1
View File
@@ -0,0 +1 @@
cfg.mak
+9 -3
View File
@@ -1,6 +1,13 @@
LOCAL_DIR := $(shell pwd)
MIDDLEWARE_DIR := $(LOCAL_DIR)
include $(MIDDLEWARE_DIR)/cfg.mak
CFG_CHIP_TYPE=hi3516dv300
CFG_OS_TYPE=linux
CFG_COMPILE_TYPE=clang
CFG_LINUX_COMPILER_VER=himix410
CFG_OHOS_BUILD_PATH=
-include $(MIDDLEWARE_DIR)/cfg.mak
GREEN="\e[32;1m"
DONE="\e[39m"
@@ -43,8 +50,7 @@ clean:
fi
$(ORG_FFMPEG):
cp $(CONFIGURE_FILE) $(FFMPEG_VER)/configure
@if [ -d $(FFMPEG_VER) ]; then cd $@; chmod 777 ./* -R; ./$(FF_CONFIG_SH) $(CFG_CHIP_TYPE) $(CFG_OS_TYPE) $(CFG_COMPILE_TYPE) $(CFG_LINUX_COMPILER_VER) $(CFG_OHOS_BUILD_PATH); cd -; fi
@if [ -d $(FFMPEG_VER) ]; then cd $@; ln -snf ../$(CONFIGURE_FILE) config.sh; CFG_CONFIGURE=./config.sh $(if $(CFG_OHOS_BUILD_PATH),LD=$(CFG_OHOS_BUILD_PATH)/clang,) ./$(FF_CONFIG_SH) $(CFG_CHIP_TYPE) $(CFG_OS_TYPE) $(CFG_COMPILE_TYPE) $(CFG_LINUX_COMPILER_VER) $(CFG_OHOS_BUILD_PATH); cd -; fi
@if [ $(FF_ADAPT_LITEOS) = 'y' ]; then cd $@; ./adapt_liteos_config.sh; cd -; fi
$(MAKE) $(MFLAGS) -j16 -C $(COMPILE_ROOT)/$@
$(MAKE) $(MFLAGS) -C $(@) install
-5
View File
@@ -1,5 +0,0 @@
CFG_CHIP_TYPE=hi3516dv300
CFG_OS_TYPE=linux
CFG_COMPILE_TYPE=clang
CFG_LINUX_COMPILER_VER=himix410
CFG_OHOS_BUILD_PATH=
+1 -1
View File
@@ -7272,7 +7272,7 @@ CC=$cc
CXX=$cxx
AS=$as
OBJCC=$objcc
LD=clang
LD=${LD:=clang}
DEPCC=$dep_cc
DEPCCFLAGS=$DEPCCFLAGS \$(CPPFLAGS)
DEPAS=$as
+11
View File
@@ -0,0 +1,11 @@
*.so
*.d
*.pc
*.ver
*.version
.config
*_list.c
install/
config.*
libavutil/avconfig.h
libavutil/ffversion.h
+4 -2
View File
@@ -40,8 +40,10 @@ all: all-yes
include $(SRC_PATH)/tools/Makefile
include $(SRC_PATH)/ffbuild/common.mak
ifeq ($(LLVM_COMPILER), y)
CFLAGS += --target=arm-liteos --sysroot=../../../../../prebuilts/lite/sysroot
LDFLAGS += --target=arm-liteos --sysroot=../../../../../prebuilts/lite/sysroot
SYSROOT_PATH ?= ../../../../../prebuilts/lite/sysroot
ARCH_CFLAGS ?= --target=arm-liteos
CFLAGS += --sysroot=$(SYSROOT_PATH) $(ARCH_CFLAGS)
LDFLAGS += --sysroot=$(SYSROOT_PATH) $(ARCH_CFLAGS)
endif
FF_EXTRALIBS := $(FFEXTRALIBS)
FF_DEP_LIBS := $(DEP_LIBS)
+1 -1
View File
@@ -98,4 +98,4 @@ export http_proxy=""
export https_proxy=""
export no_proxy=""
./configure ${configure_attr} --extra-cflags="-mfloat-abi=softfp -mfpu=neon-vfpv4 -fPIC -fstack-protector-all -s -ftrapv" --extra-ldflags="-Wl,-z,relro,-z,now -fPIC"
${CFG_CONFIGURE:=./configure} ${configure_attr} --extra-cflags="-mfloat-abi=softfp -mfpu=neon-vfpv4 -fPIC -fstack-protector-all -s -ftrapv" --extra-ldflags="-Wl,-z,relro,-z,now -fPIC"
+2 -2
View File
@@ -58,12 +58,12 @@ if [ "${CFG_CHIP_TYPE}" == "hi3518ev300" ]; then
echo "hi3518ev300 =? ${CFG_CHIP_TYPE}"
configure_attr+=" --arch=arm --cpu=cortex-a7 "
echo ${configure_attr} --extra-cflags="-mfloat-abi=softfp -mfpu=neon-vfpv4"
./configure ${configure_attr} --extra-cflags="-mfloat-abi=softfp -mfpu=neon-vfpv4 -fPIC -fstack-protector-all -s -ftrapv" --extra-ldflags="-fPIC -Wl,-z,relro,-z,now --shared"
${CFG_CONFIGURE:=./configure} ${configure_attr} --extra-cflags="-mfloat-abi=softfp -mfpu=neon-vfpv4 -fPIC -fstack-protector-all -s -ftrapv" --extra-ldflags="-fPIC -Wl,-z,relro,-z,now --shared"
fi
if [ "${CFG_CHIP_TYPE}" == "hi3516cv300" ]; then
echo "hi3516cv300 =? ${CFG_CHIP_TYPE}"
configure_attr+=" --arch=arm --cpu=arm926ej-s --cross-prefix=${CFG_SDK_TOOLCHAIN} "
./configure ${configure_attr} --extra-cflags="-nostdlib -nostdinc -fPIC -mlong-calls -fstack-protector-all -s -ftrapv" --extra-ldflags="-fPIC -Wl,-z,relro,-z,now --shared"
${CFG_CONFIGURE:=./configure} ${configure_attr} --extra-cflags="-nostdlib -nostdinc -fPIC -mlong-calls -fstack-protector-all -s -ftrapv" --extra-ldflags="-fPIC -Wl,-z,relro,-z,now --shared"
fi