Skip to content
Snippets Groups Projects
Commit 3c4a6f2f authored by Esben Haabendal's avatar Esben Haabendal
Browse files

openharmony-standard: Fix another host OS flex dependency


OpenHarmony 3.1 introduced another script which copies directly from
/usr/include/FlexLexer.h path, so we need to fix that as well in order
to not depend on host OS flex package.

Signed-off-by: default avatarEsben Haabendal <esben.haabendal@huawei.com>
parent 4de682dc
No related branches found
No related tags found
1 merge request!26Various changes in preparation for integration with meta-oniro-core
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
Fix host OS dependency on flex package by copying the FlexLexer.h file from recipe-sysroot-native.
Apply to foundation/graphic/standard repository.
Signed-off-by: Esben Haabendal <esben.haabendal@huawei.com>
Upstream-Status: Pending
diff --git a/utils/lex_yacc/gen_flexlexer_header.py b/utils/lex_yacc/gen_flexlexer_header.py
index cde71464bfe8..f32c7e68184d 100755
--- a/utils/lex_yacc/gen_flexlexer_header.py
+++ b/utils/lex_yacc/gen_flexlexer_header.py
@@ -22,10 +22,11 @@ import sys
def parse_args(args):
parser = optparse.OptionParser()
parser.add_option("--output")
+ parser.add_option("--includedir", default="/usr/include")
opts, _ = parser.parse_args(args)
return opts
if __name__ == '__main__':
options = parse_args(sys.argv[1:])
parse_scripts = subprocess.check_call(
- ["cp", "-f", "/usr/include/FlexLexer.h", options.output])
+ ["cp", "-f", "%s/FlexLexer.h"%(options.includedir,), options.output])
diff --git a/utils/lex_yacc/lex_yacc.gni b/utils/lex_yacc/lex_yacc.gni
index 5c27743c507e..905252a93cf7 100644
--- a/utils/lex_yacc/lex_yacc.gni
+++ b/utils/lex_yacc/lex_yacc.gni
@@ -15,6 +15,10 @@ import("//build/ohos.gni")
gni_filepath = "//foundation/graphic/standard/utils/lex_yacc"
+declare_args() {
+ flex_includedir = "/usr/include"
+}
+
template("lex_yacc") {
lex_name = invoker.lex
yacc_name = invoker.yacc
@@ -33,6 +37,8 @@ template("lex_yacc") {
args = [
"--output",
flexlexer_pathname,
+ "--includedir",
+ rebase_path(flex_includedir)
]
}
......@@ -66,6 +66,7 @@ SRC_URI += "file://developtools_hdc_standard-gcc.patch;patchdir=${S}/developtool
SRC_URI += "file://foundation_graphic_standard-hdi-display-layer.patch;patchdir=${S}/foundation/graphic/standard"
SRC_URI += "file://third_party_weston-hdi-display-layer.patch;patchdir=${S}/third_party/weston"
SRC_URI += "file://third_party_selinux-flex-bison-path.patch;patchdir=${S}/third_party/selinux"
SRC_URI += "file://foundation_graphic_standard-flexlexer-h.patch;patchdir=${S}/foundation/graphic/standard"
SRC_URI += "file://features.json;subdir=${OHOS_BUILD_CONFIGS_DIR}"
# Patch to allow /system/profile and /system/usr to be symlinks to /usr/lib/openharmony
......@@ -114,6 +115,7 @@ GN_ARGS += 'host_toolchain="//oniro:clang_x64"'
GN_ARGS += 'install_oniro_third_party=false'
GN_ARGS += 'flex_path="${RECIPE_SYSROOT_NATIVE}/usr/bin/flex"'
GN_ARGS += 'bison_path="${RECIPE_SYSROOT_NATIVE}/usr/bin/bison"'
GN_ARGS += 'flex_includedir="${RECIPE_SYSROOT_NATIVE}/usr/include"'
# OpenHarmony unit tests are statically linked and therefore not stripped
# binaries sum up to almost 80GB which makes it difficult to build OpenHarmony
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment