File tree 2 files changed +14
-10
lines changed
2 files changed +14
-10
lines changed Original file line number Diff line number Diff line change 1
1
{% begin % }
2
2
lib LibCrypto
3
- {% if flag?(:win32 ) % }
3
+ {% if flag?(:msvc ) % }
4
4
{% from_libressl = false % }
5
5
{% ssl_version = nil % }
6
6
{% for dir in Crystal ::LIBRARY_PATH .split(Crystal ::System ::Process ::HOST_PATH_DELIMITER ) % }
13
13
{% end % }
14
14
{% ssl_version ||= " 0.0.0" % }
15
15
{% else % }
16
- {% from_libressl = (` hash pkg-config 2> /dev/null || printf %s false` != " false" ) &&
17
- (` test -f $(pkg-config --silence-errors --variable=includedir libcrypto)/openssl/opensslv.h || printf %s false` != " false" ) &&
18
- (` printf "#include <openssl/opensslv.h>\n LIBRESSL_VERSION_NUMBER" | ${CC:-cc} $(pkg-config --cflags --silence-errors libcrypto || true) -E -` .chomp.split('\n' ).last != " LIBRESSL_VERSION_NUMBER" ) % }
19
- {% ssl_version = ` hash pkg-config 2> /dev/null && pkg-config --silence-errors --modversion libcrypto || printf %s 0.0.0` .split.last.gsub(/[^0-9.] / , " " ) % }
16
+ # these have to be wrapped in `sh -c` since for MinGW-w64 the compiler
17
+ # passes the command string to `LibC.CreateProcessW`
18
+ {% from_libressl = (` sh -c 'hash pkg-config 2> /dev/null || printf %s false'` != " false" ) &&
19
+ (` sh -c 'test -f $(pkg-config --silence-errors --variable=includedir libcrypto)/openssl/opensslv.h || printf %s false'` != " false" ) &&
20
+ (` sh -c 'printf "#include <openssl/opensslv.h>\n LIBRESSL_VERSION_NUMBER" | ${CC:-cc} $(pkg-config --cflags --silence-errors libcrypto || true) -E -'` .chomp.split('\n' ).last != " LIBRESSL_VERSION_NUMBER" ) % }
21
+ {% ssl_version = ` sh -c 'hash pkg-config 2> /dev/null && pkg-config --silence-errors --modversion libcrypto || printf %s 0.0.0'` .split.last.gsub(/[^0-9.] / , " " ) % }
20
22
{% end % }
21
23
22
24
{% if from_libressl % }
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ require "./lib_crypto"
6
6
7
7
{% begin % }
8
8
lib LibSSL
9
- {% if flag?(:win32 ) % }
9
+ {% if flag?(:msvc ) % }
10
10
{% from_libressl = false % }
11
11
{% ssl_version = nil % }
12
12
{% for dir in Crystal ::LIBRARY_PATH .split(Crystal ::System ::Process ::HOST_PATH_DELIMITER ) % }
@@ -19,10 +19,12 @@ require "./lib_crypto"
19
19
{% end % }
20
20
{% ssl_version ||= " 0.0.0" % }
21
21
{% else % }
22
- {% from_libressl = (` hash pkg-config 2> /dev/null || printf %s false` != " false" ) &&
23
- (` test -f $(pkg-config --silence-errors --variable=includedir libssl)/openssl/opensslv.h || printf %s false` != " false" ) &&
24
- (` printf "#include <openssl/opensslv.h>\n LIBRESSL_VERSION_NUMBER" | ${CC:-cc} $(pkg-config --cflags --silence-errors libssl || true) -E -` .chomp.split('\n' ).last != " LIBRESSL_VERSION_NUMBER" ) % }
25
- {% ssl_version = ` hash pkg-config 2> /dev/null && pkg-config --silence-errors --modversion libssl || printf %s 0.0.0` .split.last.gsub(/[^0-9.] / , " " ) % }
22
+ # these have to be wrapped in `sh -c` since for MinGW-w64 the compiler
23
+ # passes the command string to `LibC.CreateProcessW`
24
+ {% from_libressl = (` sh -c 'hash pkg-config 2> /dev/null || printf %s false'` != " false" ) &&
25
+ (` sh -c 'test -f $(pkg-config --silence-errors --variable=includedir libssl)/openssl/opensslv.h || printf %s false'` != " false" ) &&
26
+ (` sh -c 'printf "#include <openssl/opensslv.h>\n LIBRESSL_VERSION_NUMBER" | ${CC:-cc} $(pkg-config --cflags --silence-errors libssl || true) -E -'` .chomp.split('\n' ).last != " LIBRESSL_VERSION_NUMBER" ) % }
27
+ {% ssl_version = ` sh -c 'hash pkg-config 2> /dev/null && pkg-config --silence-errors --modversion libssl || printf %s 0.0.0'` .split.last.gsub(/[^0-9.] / , " " ) % }
26
28
{% end % }
27
29
28
30
{% if from_libressl % }
You can’t perform that action at this time.
0 commit comments