fix openssl component error

This commit is contained in:
Neucrack
2025-01-02 16:09:25 +08:00
parent e58dde16d5
commit 6ce4de8b69
3 changed files with 17 additions and 22 deletions

View File

@@ -67,12 +67,15 @@
###############################################
if(PLATFORM_LINUX)
set(compile_for_host 1)
set(compile_from_src 0)
else()
set(compile_for_host 0)
set(compile_from_src 1)
endif()
if(CONFIG_OPENSSL_COMPILE_FROM_SOURCE)
set(compile_from_src 1)
endif()
if(NOT compile_for_host)
if(compile_from_src)
if(NOT ADD_INCLUDE) # compile from source code
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpmachine OUTPUT_VARIABLE arch)
string(REGEX REPLACE "([^-]+)-.*" "\\1" arch "${arch}")
@@ -80,6 +83,9 @@ if(NOT compile_for_host)
string(LENGTH "${CONFIG_TOOLCHAIN_PREFIX}" toolchain_prefix_len)
math(EXPR toolchain_prefix_len "${toolchain_prefix_len} - 1")
string(SUBSTRING "${CONFIG_TOOLCHAIN_PREFIX}" 0 ${toolchain_prefix_len} host_prefix)
set(host_prefix "${host_prefix}-")
elseif(PLATFORM_LINUX)
set(host_prefix "")
else()
message(FATAL_ERROR "openssle compile not support this platform yet, please edit CMakeLists.txt to support")
endif()
@@ -96,7 +102,7 @@ if(NOT compile_for_host)
set(openssl_src_path "${DL_EXTRACTED_PATH}/openssl/openssl-3.0.12")
set(openssl_install_path "${target_install_dir}")
set(openssl_compile_cmd COMMAND set -x && cd ${openssl_src_path} && echo "-- compile openssl now" && make distclean || true && chmod +x ./Configure && ./Configure linux-generic32 shared -DL_ENDIAN --openssldir=${openssl_install_path} --prefix=${openssl_install_path} && export PATH=${CONFIG_TOOLCHAIN_PATH}:$ENV{PATH} && make CC="${host_prefix}"-gcc RANLIB="${host_prefix}"-ranlib LD="${host_prefix}"-ld MAKEDEPPROG="${host_prefix}"-gcc PROCESSOR=${arch} -j`nproc` && make install_sw)
set(openssl_compile_cmd COMMAND set -x && cd ${openssl_src_path} && echo "-- compile openssl now" && make distclean || true && chmod +x ./Configure && ./Configure linux-generic32 shared -DL_ENDIAN --openssldir=${openssl_install_path} --prefix=${openssl_install_path} && export PATH=${CONFIG_TOOLCHAIN_PATH}:$ENV{PATH} && make CC="${host_prefix}"gcc RANLIB="${host_prefix}"ranlib LD="${host_prefix}"ld MAKEDEPPROG="${host_prefix}"gcc PROCESSOR=${arch} -j`nproc` && make install_sw)
add_custom_command(OUTPUT ${target_h_path}
${openssl_compile_cmd}

View File

@@ -1,20 +1,7 @@
# Python version major minor patch
menu "Python version"
config PYTHON_VERSION_MAJOR
int "python package major version"
default 0
menu "OpenSSL"
config OPENSSL_COMPILE_FROM_SOURCE
bool "compile openssl from souce code"
default n
help
Python package major version, 0 means auto select according to board
config PYTHON_VERSION_MINOR
int "python package minor version"
default 0
help
Python package minor version
config PYTHON_VERSION_PATCH
int "python package patch version"
default 0
help
Python package patch version
compile openssl from source code, or use system libs
endmenu

View File

@@ -11,6 +11,8 @@ def get_depends(component, data):
depends = data[component] if component in data else []
sub_depends = []
for d in depends:
if d == component:
continue
sub_depends += get_depends(d, data)
return depends + sub_depends