You've already forked M5Stack_Linux_Libs
mirror of
https://github.com/m5stack/M5Stack_Linux_Libs.git
synced 2026-05-20 11:01:38 -07:00
7b3db295a4
- add smidjson_component - SConstruct_tool add new api
81 lines
2.6 KiB
Python
81 lines
2.6 KiB
Python
# project_root/src/SConscript
|
|
import os
|
|
import shutil
|
|
|
|
# Import the environment from the SConstruct file
|
|
Import("env")
|
|
with open(env["PROJECT_TOOL_S"]) as f:
|
|
exec(f.read())
|
|
|
|
SRCS = Glob("src/*.c*")
|
|
INCLUDE = [ADir("include"), ADir(".")]
|
|
PRIVATE_INCLUDE = []
|
|
REQUIREMENTS = ["pthread", "tommath"]
|
|
STATIC_LIB = []
|
|
DYNAMIC_LIB = []
|
|
DEFINITIONS = []
|
|
DEFINITIONS_PRIVATE = []
|
|
LDFLAGS = []
|
|
LINK_SEARCH_PATH = []
|
|
|
|
gcc_dumpmachine = env["GCC_DUMPMACHINE"].split("-")
|
|
|
|
if "arm" in gcc_dumpmachine and "gnueabihf" in gcc_dumpmachine:
|
|
package_name = "Firebird-5.0.0.1306-0-linux-arm32"
|
|
Firebird_path = str(
|
|
ADir("../../../github_source/Firebird-5.0.0.1306-0-linux-arm32")
|
|
)
|
|
down_url = "https://github.com/FirebirdSQL/firebird/releases/download/v5.0.0/Firebird-5.0.0.1306-0-linux-arm32.tar.gz"
|
|
INCLUDE.append(
|
|
ADir(
|
|
"../../../github_source/Firebird-5.0.0.1306-0-linux-arm32/Firebird-5.0.0.1306-0-linux-arm32/buildroot/opt/firebird/include"
|
|
)
|
|
)
|
|
DYNAMIC_LIB.append(
|
|
AFile(
|
|
"../../../github_source/Firebird-5.0.0.1306-0-linux-arm32/Firebird-5.0.0.1306-0-linux-arm32/buildroot/opt/firebird/lib/libfbclient.so.2"
|
|
)
|
|
)
|
|
elif "x86_64" in gcc_dumpmachine and "linux" in gcc_dumpmachine:
|
|
Firebird_path = str(ADir("../../../github_source/Firebird-5.0.0.1306-0-linux-x64"))
|
|
down_url = "https://github.com/FirebirdSQL/firebird/releases/download/v5.0.0/Firebird-5.0.0.1306-0-linux-x64.tar.gz"
|
|
package_name = "Firebird-5.0.0.1306-0-linux-x64"
|
|
INCLUDE.append(
|
|
os.path.join(str(Firebird_path), package_name, "buildroot/opt/firebird/include")
|
|
)
|
|
DYNAMIC_LIB.append(
|
|
os.path.join(
|
|
str(Firebird_path),
|
|
package_name,
|
|
"buildroot/opt/firebird/lib/libfbclient.so.2",
|
|
)
|
|
)
|
|
|
|
Firebird_path = check_wget_down(
|
|
down_url,
|
|
package_name + ".tar.gz",
|
|
)
|
|
Firebird_buildroot = os.path.join(Firebird_path, package_name, "buildroot")
|
|
if not os.path.exists(Firebird_buildroot):
|
|
import tarfile
|
|
|
|
with tarfile.open(Firebird_buildroot + ".tar.gz", "r:gz") as tar:
|
|
tar.extractall(Firebird_buildroot)
|
|
|
|
env["COMPONENTS"].append(
|
|
{
|
|
"target": env["PROJECT_NAME"],
|
|
"SRCS": SRCS,
|
|
"INCLUDE": INCLUDE,
|
|
"PRIVATE_INCLUDE": PRIVATE_INCLUDE,
|
|
"REQUIREMENTS": REQUIREMENTS,
|
|
"STATIC_LIB": STATIC_LIB,
|
|
"DYNAMIC_LIB": DYNAMIC_LIB,
|
|
"DEFINITIONS": DEFINITIONS,
|
|
"DEFINITIONS_PRIVATE": DEFINITIONS_PRIVATE,
|
|
"LDFLAGS": LDFLAGS,
|
|
"LINK_SEARCH_PATH": LINK_SEARCH_PATH,
|
|
"REGISTER": "project",
|
|
}
|
|
)
|