Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/paths.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonan Collobert <ronan@collobert.com>2014-02-15 22:24:41 +0400
committerRonan Collobert <ronan@collobert.com>2014-02-15 22:24:41 +0400
commitc4e29565cd30fae05840f0e1375be6bd760efc9b (patch)
tree2c6710d975be18c08c8e7fda167929a6e03c77be
parentbefb73a2627ba126b3daa7540afae25c9dd12516 (diff)
fix custom require (with dlopen(RTLD_GLOBAL))
-rw-r--r--CMakeLists.txt2
-rw-r--r--paths.c2
-rw-r--r--paths.h.in1
3 files changed, 4 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ce5c278..e4d2a8d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,6 +6,7 @@ LINK_DIRECTORIES("${LUA_LIBDIR}")
INCLUDE(CheckIncludeFiles)
INCLUDE(CheckFunctionExists)
+INCLUDE(CheckLibraryExists)
IF (UNIX OR NOT WIN32)
CHECK_INCLUDE_FILES(fcntl.h HAVE_FCNTL_H)
@@ -18,6 +19,7 @@ IF (UNIX OR NOT WIN32)
CHECK_INCLUDE_FILES(sys/dir.h HAVE_SYS_DIR_H)
CHECK_INCLUDE_FILES(ndir.h HAVE_NDIR_H)
CHECK_FUNCTION_EXISTS(getcwd HAVE_GETCWD)
+ CHECK_LIBRARY_EXISTS(dl dlopen "" HAVE_DLOPEN)
ENDIF (UNIX OR NOT WIN32)
CONFIGURE_FILE("paths.h.in" "${CMAKE_CURRENT_BINARY_DIR}/paths.h")
diff --git a/paths.c b/paths.c
index 011ad2c..6111cfa 100644
--- a/paths.c
+++ b/paths.c
@@ -953,7 +953,7 @@ lua_getregistryvalue(lua_State *L)
/* ------------------------------------------------------ */
/* require (with global flag) */
-#ifdef LUA_USE_DLOPEN
+#ifdef HAVE_DLOPEN
# define NEED_PATH_REQUIRE 1
# include <dlfcn.h>
# ifndef RTLD_LAZY
diff --git a/paths.h.in b/paths.h.in
index 31f9014..143f034 100644
--- a/paths.h.in
+++ b/paths.h.in
@@ -43,6 +43,7 @@
#cmakedefine HAVE_SYS_UTSNAME_H 1
#cmakedefine HAVE_NDIR_H 1
#cmakedefine HAVE_GETCWD 1
+#cmakedefine HAVE_DLOPEN 1
# include <errno.h>
# include <sys/types.h>