void-packages/srcpkgs/cbang/patches/0002-config-openssl-check-OPENSSL_VERSION-in-compile-time.patch
Đoàn Trần Công Danh 736ce9ffd8 cbang: cross compiling
2020-05-18 00:32:13 +02:00

47 lines
1.4 KiB
Diff

From a2d81dfceb153d6388dcff63d8be1140cad7a33e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
<congdanhqx@gmail.com>
Date: Sun, 17 May 2020 22:26:09 +0700
Subject: [PATCH 2/5] config/openssl: check OPENSSL_VERSION in compile time
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
All of required information are available at compile time, use compile
time check to support cross compiling.
Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
---
config/openssl/__init__.py | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git config/openssl/__init__.py config/openssl/__init__.py
index e0d3884a..580d72e7 100644
--- config/openssl/__init__.py
+++ config/openssl/__init__.py
@@ -9,17 +9,19 @@ def check_version(context, version):
src = '''
#include <openssl/opensslv.h>
int main() {
- return (OPENSSL_VERSION_NUMBER >= '''
+ int a[(OPENSSL_VERSION_NUMBER >= '''
src += '(' + version[0] + ' >> 28)'
if 1 < len(version):
src += ' + (' + version[1] + ' >> 20)'
if 2 < len(version):
src += ' + (' + version[2] + ' >> 12)'
- src += ''') ? 0 : 1;
+ src += ''')];
+ a[0] = 0;
+ return 0;
}
'''
- ret = context.TryRun(src, '.cpp')[0]
+ ret = context.TryCompile(src, '.cpp')
context.Result(ret)
return ret
--
2.26.2.672.g232c24e857