提交 2f05f070 编写于 作者: C Caoruihong

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

build should not modify files in the repository,
we made this done by .gitignore rules.
sysroot and arch related cflags are pass by BUILD.gn now.
Signed-off-by: NCaoruihong <crh.cao@huawei.com>
Change-Id: Id167da03c5076871cf0f35bc1771f5b428d0cc9f
上级 648b57b6
*.o
*.d
*.a
*.so
hostapd/hostapd_cli
wpa_supplicant/wpa_cli
wpa_supplicant/wpa_passphrase
......@@ -9,7 +9,10 @@ build_ext_component("wpa_supplicant-2.9") {
clang_dir = rebase_path("${ohos_build_compiler_dir}")
}
outdir = rebase_path("$root_out_dir")
command = "sh build.sh ${outdir} ${ohos_build_compiler} ${ohos_build_ndk} ${ohos_build_type} ${clang_dir} ${ohos_kernel_type}"
sysroot_path = rebase_path(ohos_current_sysroot)
arch_cflags = string_join(" ", target_arch_cflags)
arch_cflags += " --target=$target_triple"
command = "sh build.sh ${outdir} ${ohos_build_compiler} ${ohos_build_ndk} ${ohos_build_type} ${clang_dir} ${ohos_kernel_type} ${sysroot_path} \"${arch_cflags}\""
exec_path = rebase_path(".", root_build_dir)
deps = [
"//drivers/adapter/uhdf/manager:hdf_core",
......
......@@ -90,4 +90,11 @@ main()
fi
}
if [ "x" != "x$7" ]; then
export SYSROOT_PATH=$7
fi
if [ "x" != "x$8" ]; then
export ARCH_CFLAGS="$8"
fi
main $1 $2 $3 $4 $5 $6
......@@ -10,17 +10,13 @@ CFLAGS := -flto -MMD -O2 -g -w -fsigned-char
endif
ifeq ($(COMPILER_TYPE), clang)
SYSROOT_PATH ?= ../../../../prebuilts/lite/sysroot
ARCH_CFLAGS ?= --target=arm-liteos -march=armv7-a -mfloat-abi=softfp
CC := $(COMPILER_DIR)/bin/clang
AR := $(COMPILER_DIR)/bin/llvm-ar
CFLAGS += --target=arm-liteos
CFLAGS += -march=armv7-a
CFLAGS += -mfloat-abi=softfp
CFLAGS += --sysroot=../../../../prebuilts/lite/sysroot
CFLAGS += --sysroot=$(SYSROOT_PATH) $(ARCH_CFLAGS)
CFLAGS += -I$(abspath ../../../../drivers/peripheral/wlan/client/include)
LDFLAGS = -fuse-ld=lld
LDFLAGS += --target=arm-liteos
LDFLAGS += --sysroot=../../../../prebuilts/lite/sysroot
LDFLAGS += --sysroot=$(SYSROOT_PATH) $(ARCH_CFLAGS)
LDFLAGS += -lc
LDFLAGS += -v
endif
......
......@@ -58,15 +58,11 @@ export BINDIR ?= /usr/local/bin/
-include .config
ifeq ($(COMPILER_TYPE), clang)
SYSROOT_PATH ?= ../../../../prebuilts/lite/sysroot
ARCH_CFLAGS ?= --target=arm-liteos -march=armv7-a -mfloat-abi=softfp
CC := $(COMPILER_DIR)/bin/clang
CFLAGS += --target=arm-liteos
CFLAGS += -march=armv7-a
CFLAGS += -mfloat-abi=softfp
CFLAGS += --sysroot=../../../../prebuilts/lite/sysroot
LDFLAGS = -fuse-ld=lld
LDFLAGS += --target=arm-liteos
LDFLAGS += --sysroot=../../../../prebuilts/lite/sysroot
CFLAGS += --sysroot=$(SYSROOT_PATH) $(ARCH_CFLAGS)
LDFLAGS += --sysroot=$(SYSROOT_PATH) $(ARCH_CFLAGS)
LDFLAGS += -lc
endif
......
......@@ -70,16 +70,11 @@ LIBS += -L$(DEPDIR) -lhdf_core -lhdf_osal -lsec_shared -lhilog_shared -lwifi_dri
-include .config
ifeq ($(COMPILER_TYPE), clang)
SYSROOT_PATH ?= ../../../../prebuilts/lite/sysroot
ARCH_CFLAGS ?= --target=arm-liteos -march=armv7-a -mfloat-abi=softfp
CC := $(COMPILER_DIR)/bin/clang
CFLAGS += --target=arm-liteos
CFLAGS += -march=armv7-a
CFLAGS += -mfloat-abi=softfp
CFLAGS += --sysroot=../../../../prebuilts/lite/sysroot
LDFLAGS = -fuse-ld=lld
LDFLAGS += --target=arm-liteos
LDFLAGS += --sysroot=../../../../prebuilts/lite/sysroot
CFLAGS += --sysroot=$(SYSROOT_PATH) $(ARCH_CFLAGS)
LDFLAGS += --sysroot=$(SYSROOT_PATH) $(ARCH_CFLAGS)
LDFLAGS += -lc
endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册