packages/libs/gost_engine/patches/020-cmake-allow-cross-compile.patch
Eneas U de Queiroz 7fedfbaec8 gost_engine: adapt to new engine build config
This adapts the package to the new include/openssl-module.mk, and
updated runtime configuration.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2023-09-15 10:57:19 +08:00

60 lines
1.3 KiB
Diff

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -64,31 +64,35 @@ else()
add_definitions(-DL_ENDIAN)
endif()
-check_c_source_runs("
- #ifdef _MSC_VER
- # include <intrin.h>
- #else
- # include <x86intrin.h>
- #endif
- int main(void) {
- unsigned long long x = -1, y = 1, r;
- unsigned char cf;
- cf = _addcarry_u64(1, x, y, &r);
- return !(cf == 1 && r == 1);
- }
- " ADDCARRY_U64)
+if(NOT CMAKE_CROSSCOMPILING)
+ check_c_source_runs("
+ #ifdef _MSC_VER
+ # include <intrin.h>
+ #else
+ # include <x86intrin.h>
+ #endif
+ int main(void) {
+ unsigned long long x = -1, y = 1, r;
+ unsigned char cf;
+ cf = _addcarry_u64(1, x, y, &r);
+ return !(cf == 1 && r == 1);
+ }
+ " ADDCARRY_U64)
+
+ check_c_source_runs("
+ int main(void) {
+ char buf[16] = { 0, 1, 2 };
+ int *p = (int *)(buf + 1);
+ int *q = (int *)(buf + 2);
+ return (*p == *q);
+ }
+ " RELAXED_ALIGNMENT)
+endif()
+
if (ADDCARRY_U64)
add_definitions(-DHAVE_ADDCARRY_U64)
endif()
-check_c_source_runs("
- int main(void) {
- char buf[16] = { 0, 1, 2 };
- int *p = (int *)(buf + 1);
- int *q = (int *)(buf + 2);
- return (*p == *q);
- }
- " RELAXED_ALIGNMENT)
if (NOT RELAXED_ALIGNMENT)
add_definitions(-DSTRICT_ALIGNMENT)
endif()