Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Libdl is now a separate module
  • Loading branch information
tkelman committed Mar 16, 2015
1 parent d9a7a73 commit eefc5ba
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 7 additions & 1 deletion src/BinDeps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ module BinDeps
ChangeDirectory, FileDownloader, FileUnpacker, prepare_src,
autotools_install, CreateDirectory, MakeTargets, SystemLibInstall

const dlext = isdefined(Base.Sys, :shlib_ext) ? Base.Sys.shlib_ext : Base.Sys.dlext # Julia 0.2/0.3 compatibility
if VERSION >= v"0.4.0-dev+3844"
import Base.Libdl: dlext, dlpath, RTLD_LAZY, DL_LOAD_PATH
else
const dlext = isdefined(Base.Sys, :shlib_ext) ? Base.Sys.shlib_ext : Base.Sys.dlext # Julia 0.2/0.3 compatibility
dlpath = Sys.dlpath
DL_LOAD_PATH = Base.DL_LOAD_PATH
end
const shlib_ext = dlext # compatibility with older packages (e.g. ZMQ)

function find_library(pkg,libname,files)
Expand Down
6 changes: 3 additions & 3 deletions src/dependencies.jl
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ function _find_library(dep::LibraryDependency; provider = Any)
if h != C_NULL
works = dep.libvalidate(l,h)
if VERSION >= v"0.3-"
l = Sys.dlpath(h)
l = dlpath(h)
end
dlclose(h)
if works
Expand Down Expand Up @@ -504,7 +504,7 @@ function _find_library(dep::LibraryDependency; provider = Any)
# We don't want to use regular dlopen, because we want to get at
# system libraries even if one of our providers is higher in the
# DL_LOAD_PATH
for path in Base.DL_LOAD_PATH
for path in DL_LOAD_PATH
for ext in EXTENSIONS
opath = string(joinpath(path,lib),ext)
check_path!(ret,dep,opath)
Expand Down Expand Up @@ -537,7 +537,7 @@ if VERSION >= v"0.3-"

function check_system_handle!(ret,dep,handle)
if handle != C_NULL
libpath = Sys.dlpath(handle)
libpath = dlpath(handle)
# Check that this is not a duplicate
for p in ret
try
Expand Down

0 comments on commit eefc5ba

Please sign in to comment.