summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-04-25 06:38:13 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-04-25 06:38:13 -0700
commitd081a595dfa053c78f7e3f580f82ca7823f02f74 (patch)
treeea4b7b8312130645b67e980c6581fcda17ba1af1 /configure
parent0a4bbf74bdc55ed80e72aac2941dcd6aefc153b3 (diff)
downloadtxr-d081a595dfa053c78f7e3f580f82ca7823f02f74.tar.gz
txr-d081a595dfa053c78f7e3f580f82ca7823f02f74.tar.bz2
txr-d081a595dfa053c78f7e3f580f82ca7823f02f74.zip
Provide access to dlopen.
* configure: New test for dlopen. * lib.c (cptr_equal_op): Function renamed to cobj_equal_handle_op, to reflect what it's really doing; it is not specifically to cptr objects. Also changed from static to extern. (cptr_ops): Follow rename. * lib.h (cobj_equal_handle_op): Declared. * sysif.c (cptr_dl_destroy_op): New static function. (dlopen_wrap, dlclose_wrap, dlsym_wrap, dlvsym_wrap): New static functions. (sysif_init): Register new intrinsic functions dlopen, dlclose, dlsym, dlvsym. New variables rtld-lazy, rtld-now, rtld-global, rtld-local, rtld-nodelete, rtld-noload, rtld-deepbind.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure36
1 files changed, 36 insertions, 0 deletions
diff --git a/configure b/configure
index 0147bd9d..648c8d4c 100755
--- a/configure
+++ b/configure
@@ -2746,6 +2746,42 @@ else
printf "no\n"
fi
+printf "Checking for dlopen ... "
+
+cat > conftest.c <<!
+#include <dlfcn.h>
+
+int main(void)
+{
+ void *lib = dlopen("foo.so", 0);
+ void *sym = dlsym(lib, "bar");
+#if TEST_DLVSYM
+ void *vsym = dlsvym(lib, "bar", "1");
+#endif
+ dlclose(lib);
+ return 0;
+}
+!
+
+if conftest ; then
+ printf "yes\n"
+ printf "#define HAVE_DLOPEN 1\n" >> config.h
+elif conftest EXTRA_LDFLAGS=-ldl ; then
+ printf "yes\n"
+ printf "#define HAVE_DLOPEN 1\n" >> config.h
+ conf_ldflags="${conf_ldflags:+"$conf_ldflags "}-ldl"
+else
+ printf "no\n"
+fi
+
+printf "Checking for dlsvsym ... "
+if conftest CONF_LDFLAGS="$conf_ldflags" EXTRA_CFLAGS=-DTEST_DLVSYM=1 ; then
+ printf "yes\n"
+ printf "#define HAVE_DLVSYM 1\n" >> config.h
+else
+ printf "no\n"
+fi
+
printf "Checking for libffi ... "
cat > conftest.c <<!