Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow dlopen_flags=nothing to not dlopen libraries #24

Merged
merged 1 commit into from
Dec 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "JLLWrappers"
uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210"
authors = ["Mosè Giordano", "Elliot Saba"]
version = "1.1.4"
version = "1.2.0"

[compat]
julia = "1.0.0"
Expand Down
7 changes: 5 additions & 2 deletions src/products/library_generators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,11 @@ macro init_library_product(product_name, product_path, dlopen_flags)
global $(path_name) = joinpath(artifact_dir, $(product_path))
# Manually `dlopen()` this right now so that future invocations
# of `ccall` with its path/SONAME will find this path immediately.
global $(handle_name) = dlopen($(path_name), $(dlopen_flags))
push!(LIBPATH_list, joinpath(artifact_dir, $(dirname(product_path))))
# dlopen_flags === nothing means to not dlopen the library.
if $(dlopen_flags) !== nothing
global $(handle_name) = dlopen($(path_name), $(dlopen_flags))
push!(LIBPATH_list, joinpath(artifact_dir, $(dirname(product_path))))
end
end,
init_new_library_product(product_name),
)
Expand Down
6 changes: 6 additions & 0 deletions test/OpenLibm_jll/src/wrappers/aarch64-linux-gnu.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@ export libopenlibm

JLLWrappers.@generate_wrapper_header("OpenLibm")
JLLWrappers.@declare_library_product(libopenlibm, "libopenlibm.so.3")
JLLWrappers.@declare_library_product(libnonexisting, "libnonexisting.so.0")
function __init__()
JLLWrappers.@generate_init_header()
JLLWrappers.@init_library_product(
libopenlibm,
"lib/libopenlibm.so",
RTLD_LAZY | RTLD_DEEPBIND,
)
JLLWrappers.@init_library_product(
libnonexisting,
"lib/libnonexisting.so",
nothing,
)

JLLWrappers.@generate_init_footer()
end # __init__()
6 changes: 6 additions & 0 deletions test/OpenLibm_jll/src/wrappers/aarch64-linux-musl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@ export libopenlibm

JLLWrappers.@generate_wrapper_header("OpenLibm")
JLLWrappers.@declare_library_product(libopenlibm, "libopenlibm.so.3")
JLLWrappers.@declare_library_product(libnonexisting, "libnonexisting.so.0")
function __init__()
JLLWrappers.@generate_init_header()
JLLWrappers.@init_library_product(
libopenlibm,
"lib/libopenlibm.so",
RTLD_LAZY | RTLD_DEEPBIND,
)
JLLWrappers.@init_library_product(
libnonexisting,
"lib/libnonexisting.so",
nothing,
)

JLLWrappers.@generate_init_footer()
end # __init__()
6 changes: 6 additions & 0 deletions test/OpenLibm_jll/src/wrappers/armv7l-linux-gnueabihf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@ export libopenlibm

JLLWrappers.@generate_wrapper_header("OpenLibm")
JLLWrappers.@declare_library_product(libopenlibm, "libopenlibm.so.3")
JLLWrappers.@declare_library_product(libnonexisting, "libnonexisting.so.0")
function __init__()
JLLWrappers.@generate_init_header()
JLLWrappers.@init_library_product(
libopenlibm,
"lib/libopenlibm.so",
RTLD_LAZY | RTLD_DEEPBIND,
)
JLLWrappers.@init_library_product(
libnonexisting,
"lib/libnonexisting.so",
nothing,
)

JLLWrappers.@generate_init_footer()
end # __init__()
6 changes: 6 additions & 0 deletions test/OpenLibm_jll/src/wrappers/armv7l-linux-musleabihf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@ export libopenlibm

JLLWrappers.@generate_wrapper_header("OpenLibm")
JLLWrappers.@declare_library_product(libopenlibm, "libopenlibm.so.3")
JLLWrappers.@declare_library_product(libnonexisting, "libnonexisting.so.0")
function __init__()
JLLWrappers.@generate_init_header()
JLLWrappers.@init_library_product(
libopenlibm,
"lib/libopenlibm.so",
RTLD_LAZY | RTLD_DEEPBIND,
)
JLLWrappers.@init_library_product(
libnonexisting,
"lib/libnonexisting.so",
nothing,
)

JLLWrappers.@generate_init_footer()
end # __init__()
6 changes: 6 additions & 0 deletions test/OpenLibm_jll/src/wrappers/i686-linux-gnu.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@ export libopenlibm

JLLWrappers.@generate_wrapper_header("OpenLibm")
JLLWrappers.@declare_library_product(libopenlibm, "libopenlibm.so.3")
JLLWrappers.@declare_library_product(libnonexisting, "libnonexisting.so.0")
function __init__()
JLLWrappers.@generate_init_header()
JLLWrappers.@init_library_product(
libopenlibm,
"lib/libopenlibm.so",
RTLD_LAZY | RTLD_DEEPBIND,
)
JLLWrappers.@init_library_product(
libnonexisting,
"lib/libnonexisting.so",
nothing,
)

JLLWrappers.@generate_init_footer()
end # __init__()
6 changes: 6 additions & 0 deletions test/OpenLibm_jll/src/wrappers/i686-linux-musl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@ export libopenlibm

JLLWrappers.@generate_wrapper_header("OpenLibm")
JLLWrappers.@declare_library_product(libopenlibm, "libopenlibm.so.3")
JLLWrappers.@declare_library_product(libnonexisting, "libnonexisting.so.0")
function __init__()
JLLWrappers.@generate_init_header()
JLLWrappers.@init_library_product(
libopenlibm,
"lib/libopenlibm.so",
RTLD_LAZY | RTLD_DEEPBIND,
)
JLLWrappers.@init_library_product(
libnonexisting,
"lib/libnonexisting.so",
nothing,
)

JLLWrappers.@generate_init_footer()
end # __init__()
6 changes: 6 additions & 0 deletions test/OpenLibm_jll/src/wrappers/i686-w64-mingw32.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@ export libopenlibm

JLLWrappers.@generate_wrapper_header("OpenLibm")
JLLWrappers.@declare_library_product(libopenlibm, "libopenlibm.dll")
JLLWrappers.@declare_library_product(libnonexisting, "libnonexisting.dll")
function __init__()
JLLWrappers.@generate_init_header()
JLLWrappers.@init_library_product(
libopenlibm,
"bin/libopenlibm.dll",
RTLD_LAZY | RTLD_DEEPBIND,
)
JLLWrappers.@init_library_product(
libnonexisting,
"bin/libnonexisting.dll",
nothing,
)

JLLWrappers.@generate_init_footer()
end # __init__()
6 changes: 6 additions & 0 deletions test/OpenLibm_jll/src/wrappers/powerpc64le-linux-gnu.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@ export libopenlibm

JLLWrappers.@generate_wrapper_header("OpenLibm")
JLLWrappers.@declare_library_product(libopenlibm, "libopenlibm.so.3")
JLLWrappers.@declare_library_product(libnonexisting, "libnonexisting.so.0")
function __init__()
JLLWrappers.@generate_init_header()
JLLWrappers.@init_library_product(
libopenlibm,
"lib/libopenlibm.so",
RTLD_LAZY | RTLD_DEEPBIND,
)
JLLWrappers.@init_library_product(
libnonexisting,
"lib/libnonexisting.so",
nothing,
)

JLLWrappers.@generate_init_footer()
end # __init__()
6 changes: 6 additions & 0 deletions test/OpenLibm_jll/src/wrappers/x86_64-apple-darwin.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@ export libopenlibm

JLLWrappers.@generate_wrapper_header("OpenLibm")
JLLWrappers.@declare_library_product(libopenlibm, "@rpath/libopenlibm.3.dylib")
JLLWrappers.@declare_library_product(libnonexisting, "libnonexisting.0.dylib")
function __init__()
JLLWrappers.@generate_init_header()
JLLWrappers.@init_library_product(
libopenlibm,
"lib/libopenlibm.3.0.dylib",
RTLD_LAZY | RTLD_DEEPBIND,
)
JLLWrappers.@init_library_product(
libnonexisting,
"lib/libnonexisting.0.0.dylib",
nothing,
)

JLLWrappers.@generate_init_footer()
end # __init__()
6 changes: 6 additions & 0 deletions test/OpenLibm_jll/src/wrappers/x86_64-linux-gnu.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@ export libopenlibm

JLLWrappers.@generate_wrapper_header("OpenLibm")
JLLWrappers.@declare_library_product(libopenlibm, "libopenlibm.so.3")
JLLWrappers.@declare_library_product(libnonexisting, "libnonexisting.so.0")
function __init__()
JLLWrappers.@generate_init_header()
JLLWrappers.@init_library_product(
libopenlibm,
"lib/libopenlibm.so",
RTLD_LAZY | RTLD_DEEPBIND,
)
JLLWrappers.@init_library_product(
libnonexisting,
"lib/libnonexisting.so",
nothing,
)

JLLWrappers.@generate_init_footer()
end # __init__()
6 changes: 6 additions & 0 deletions test/OpenLibm_jll/src/wrappers/x86_64-linux-musl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@ export libopenlibm

JLLWrappers.@generate_wrapper_header("OpenLibm")
JLLWrappers.@declare_library_product(libopenlibm, "libopenlibm.so.3")
JLLWrappers.@declare_library_product(libnonexisting, "libnonexisting.so.0")
function __init__()
JLLWrappers.@generate_init_header()
JLLWrappers.@init_library_product(
libopenlibm,
"lib/libopenlibm.so",
RTLD_LAZY | RTLD_DEEPBIND,
)
JLLWrappers.@init_library_product(
libnonexisting,
"lib/libnonexisting.so",
nothing,
)

JLLWrappers.@generate_init_footer()
end # __init__()
6 changes: 6 additions & 0 deletions test/OpenLibm_jll/src/wrappers/x86_64-unknown-freebsd11.1.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@ export libopenlibm

JLLWrappers.@generate_wrapper_header("OpenLibm")
JLLWrappers.@declare_library_product(libopenlibm, "libopenlibm.so.3")
JLLWrappers.@declare_library_product(libnonexisting, "libnonexisting.so.0")
function __init__()
JLLWrappers.@generate_init_header()
JLLWrappers.@init_library_product(
libopenlibm,
"lib/libopenlibm.so",
RTLD_LAZY | RTLD_DEEPBIND,
)
JLLWrappers.@init_library_product(
libnonexisting,
"lib/libnonexisting.so",
nothing,
)

JLLWrappers.@generate_init_footer()
end # __init__()
6 changes: 6 additions & 0 deletions test/OpenLibm_jll/src/wrappers/x86_64-w64-mingw32.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@ export libopenlibm

JLLWrappers.@generate_wrapper_header("OpenLibm")
JLLWrappers.@declare_library_product(libopenlibm, "libopenlibm.dll")
JLLWrappers.@declare_library_product(libnonexisting, "libnonexisting.dll")
function __init__()
JLLWrappers.@generate_init_header()
JLLWrappers.@init_library_product(
libopenlibm,
"bin/libopenlibm.dll",
RTLD_LAZY | RTLD_DEEPBIND,
)
JLLWrappers.@init_library_product(
libnonexisting,
"bin/libnonexisting.dll",
nothing,
)

JLLWrappers.@generate_init_footer()
end # __init__()
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ module TestJLL end
@test isdir(@eval TestJLL OpenLibm_jll.artifact_dir)
@test isempty(@eval TestJLL OpenLibm_jll.PATH[])
@test occursin(Sys.BINDIR, @eval TestJLL OpenLibm_jll.LIBPATH[])
@test C_NULL == @eval TestJLL OpenLibm_jll.libnonexisting_handle

# Issue #20
if Sys.iswindows()
Expand Down