summaryrefslogtreecommitdiff
path: root/source4/scripting/ejs
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2006-03-21 07:08:08 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:58:59 -0500
commitdab516d3e72360a10962d37a06df6aee33b1a63f (patch)
tree9161fd6fbe309b1c0a723d6d7a4591250ddbd8f8 /source4/scripting/ejs
parentd64ccc01769ce274c74d8458f9ef81cdcc8986f6 (diff)
downloadsamba-dab516d3e72360a10962d37a06df6aee33b1a63f.tar.gz
samba-dab516d3e72360a10962d37a06df6aee33b1a63f.tar.bz2
samba-dab516d3e72360a10962d37a06df6aee33b1a63f.zip
r14603: Fix building of ejs modules as shared libs
Fix calling of ejs_exception() without requiring --export-dynamic (This used to be commit 8575e9a4903450aae1f29f55aae516085a9528bb)
Diffstat (limited to 'source4/scripting/ejs')
-rw-r--r--source4/scripting/ejs/config.mk4
-rw-r--r--source4/scripting/ejs/smbcalls.c10
-rw-r--r--source4/scripting/ejs/smbscript.c4
3 files changed, 14 insertions, 4 deletions
diff --git a/source4/scripting/ejs/config.mk b/source4/scripting/ejs/config.mk
index ac24b58359..c38caeabf1 100644
--- a/source4/scripting/ejs/config.mk
+++ b/source4/scripting/ejs/config.mk
@@ -60,7 +60,9 @@ INIT_FUNCTION = smb_setup_ejs_system
#######################
# Start LIBRARY smbcalls
-[SUBSYSTEM::smbcalls]
+[LIBRARY::smbcalls]
+SO_VERSION = 0
+VERSION = 0.0.1
PRIVATE_PROTO_HEADER = proto.h
OBJ_FILES = \
smbcalls.o \
diff --git a/source4/scripting/ejs/smbcalls.c b/source4/scripting/ejs/smbcalls.c
index e010f3fdb1..1bfbd3b47a 100644
--- a/source4/scripting/ejs/smbcalls.c
+++ b/source4/scripting/ejs/smbcalls.c
@@ -121,15 +121,23 @@ static int ejs_version(MprVarHandle eid, int argc, struct MprVar **argv)
return 0;
}
+static void (*ejs_exception_handler) (const char *) = NULL;
+
+_PUBLIC_ void ejs_exception(const char *reason)
+{
+ ejs_exception_handler(reason);
+}
/*
setup C functions that be called from ejs
*/
-void smb_setup_ejs_functions(void)
+void smb_setup_ejs_functions(void (*exception_handler)(const char *))
{
init_module_fn static_init[] = STATIC_smbcalls_MODULES;
init_module_fn *shared_init;
+ ejs_exception_handler = exception_handler;
+
smb_setup_ejs_cli();
smb_setup_ejs_options();
smb_setup_ejs_credentials();
diff --git a/source4/scripting/ejs/smbscript.c b/source4/scripting/ejs/smbscript.c
index 86947bdf8e..d602a7733b 100644
--- a/source4/scripting/ejs/smbscript.c
+++ b/source4/scripting/ejs/smbscript.c
@@ -30,7 +30,7 @@
static EjsId eid;
-_PUBLIC_ void ejs_exception(const char *reason)
+static void smbscript_ejs_exception(const char *reason)
{
Ejs *ep = ejsPtr(eid);
ejsSetErrorMsg(eid, "%s", reason);
@@ -72,7 +72,7 @@ int main(int argc, const char **argv)
exit(127);
}
- smb_setup_ejs_functions();
+ smb_setup_ejs_functions(smbscript_ejs_exception);
if ((eid = ejsOpenEngine(handle, 0)) == (EjsId)-1) {
fprintf(stderr, "smbscript: ejsOpenEngine(): unable to "