forked from JuliaLang/julia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMbedTLS_jll.jl
61 lines (52 loc) · 2.05 KB
/
MbedTLS_jll.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# This file is a part of Julia. License is MIT: https://julialang.org/license
## dummy stub for https://github.com/JuliaBinaryWrappers/MbedTLS_jll.jl
baremodule MbedTLS_jll
using Base, Libdl
const PATH_list = String[]
const LIBPATH_list = String[]
export libmbedcrypto, libmbedtls, libmbedx509
# These get calculated in __init__()
const PATH = Ref("")
const LIBPATH = Ref("")
artifact_dir::String = ""
libmbedcrypto_handle::Ptr{Cvoid} = C_NULL
libmbedcrypto_path::String = ""
libmbedtls_handle::Ptr{Cvoid} = C_NULL
libmbedtls_path::String = ""
libmbedx509_handle::Ptr{Cvoid} = C_NULL
libmbedx509_path::String = ""
if Sys.iswindows()
const libmbedcrypto = "libmbedcrypto.dll"
const libmbedtls = "libmbedtls.dll"
const libmbedx509 = "libmbedx509.dll"
elseif Sys.isapple()
const libmbedcrypto = "@rpath/libmbedcrypto.7.dylib"
const libmbedtls = "@rpath/libmbedtls.14.dylib"
const libmbedx509 = "@rpath/libmbedx509.1.dylib"
else
const libmbedcrypto = "libmbedcrypto.so.7"
const libmbedtls = "libmbedtls.so.14"
const libmbedx509 = "libmbedx509.so.1"
end
function __init__()
global libmbedcrypto_handle = dlopen(libmbedcrypto)
global libmbedcrypto_path = dlpath(libmbedcrypto_handle)
global libmbedtls_handle = dlopen(libmbedtls)
global libmbedtls_path = dlpath(libmbedtls_handle)
global libmbedx509_handle = dlopen(libmbedx509)
global libmbedx509_path = dlpath(libmbedx509_handle)
global artifact_dir = dirname(Sys.BINDIR)
LIBPATH[] = dirname(libmbedtls_path)
push!(LIBPATH_list, LIBPATH[])
end
# JLLWrappers API compatibility shims. Note that not all of these will really make sense.
# For instance, `find_artifact_dir()` won't actually be the artifact directory, because
# there isn't one. It instead returns the overall Julia prefix.
is_available() = true
find_artifact_dir() = artifact_dir
dev_jll() = error("stdlib JLLs cannot be dev'ed")
best_wrapper = nothing
get_libmbedcrypto_path() =libmbedcrypto_path
get_libmbedtls_path() = libmbedtls_path
get_libmbedx509_path() = libmbedx509_path
end # module MbedTLS_jll