From dab516d3e72360a10962d37a06df6aee33b1a63f Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 21 Mar 2006 07:08:08 +0000 Subject: r14603: Fix building of ejs modules as shared libs Fix calling of ejs_exception() without requiring --export-dynamic (This used to be commit 8575e9a4903450aae1f29f55aae516085a9528bb) --- source4/build/smb_build/config_mk.pm | 2 ++ source4/lib/ldb/config.mk | 4 ++-- source4/librpc/config.mk | 7 ++++--- source4/scripting/ejs/config.mk | 4 +++- source4/scripting/ejs/smbcalls.c | 10 +++++++++- source4/scripting/ejs/smbscript.c | 4 ++-- source4/web_server/http.c | 6 +++--- 7 files changed, 25 insertions(+), 12 deletions(-) (limited to 'source4') diff --git a/source4/build/smb_build/config_mk.pm b/source4/build/smb_build/config_mk.pm index 41e90c33b7..a3cc42b1e7 100644 --- a/source4/build/smb_build/config_mk.pm +++ b/source4/build/smb_build/config_mk.pm @@ -44,6 +44,8 @@ my $section_types = { "REQUIRED_SUBSYSTEMS" => "list", + "ALIASES" => "list", + "ENABLE" => "bool", "OUTPUT_TYPE" => "string", diff --git a/source4/lib/ldb/config.mk b/source4/lib/ldb/config.mk index 2f36042ab9..958cd434f1 100644 --- a/source4/lib/ldb/config.mk +++ b/source4/lib/ldb/config.mk @@ -9,8 +9,8 @@ OBJ_FILES = \ ################################################ ################################################ -# Start MODULE ldb_sort -[MODULE::ldb_sort] +# Start MODULE ldb_server_sort +[MODULE::ldb_server_sort] INIT_FUNCTION = ldb_sort_init SUBSYSTEM = ldb OBJ_FILES = \ diff --git a/source4/librpc/config.mk b/source4/librpc/config.mk index 0f9f808aa8..93ea86f8e3 100644 --- a/source4/librpc/config.mk +++ b/source4/librpc/config.mk @@ -639,7 +639,7 @@ REQUIRED_SUBSYSTEMS = dcerpc NDR_SECURITY EJSRPC INIT_FUNCTION = ejs_init_lsarpc OBJ_FILES = gen_ndr/ndr_lsa_ejs.o SUBSYSTEM = smbcalls -REQUIRED_SUBSYSTEMS = dcerpc NDR_LSA EJSRPC RPC_EJS_SECURITY +REQUIRED_SUBSYSTEMS = dcerpc NDR_LSA EJSRPC RPC_EJS_SECURITY RPC_EJS_MISC [MODULE::RPC_EJS_DFS] INIT_FUNCTION = ejs_init_netdfs @@ -670,7 +670,7 @@ REQUIRED_SUBSYSTEMS = dcerpc NDR_WKSSVC EJSRPC RPC_EJS_SRVSVC RPC_EJS_MISC INIT_FUNCTION = ejs_init_srvsvc OBJ_FILES = gen_ndr/ndr_srvsvc_ejs.o SUBSYSTEM = smbcalls -REQUIRED_SUBSYSTEMS = dcerpc NDR_SRVSVC EJSRPC RPC_EJS_MISC +REQUIRED_SUBSYSTEMS = dcerpc NDR_SRVSVC EJSRPC RPC_EJS_MISC RPC_EJS_SVCCTL [MODULE::RPC_EJS_EVENTLOG] INIT_FUNCTION = ejs_init_eventlog @@ -682,7 +682,8 @@ REQUIRED_SUBSYSTEMS = dcerpc NDR_EVENTLOG EJSRPC RPC_EJS_MISC INIT_FUNCTION = ejs_init_winreg OBJ_FILES = gen_ndr/ndr_winreg_ejs.o SUBSYSTEM = smbcalls -REQUIRED_SUBSYSTEMS = dcerpc NDR_WINREG EJSRPC RPC_EJS_INITSHUTDOWN +REQUIRED_SUBSYSTEMS = dcerpc NDR_WINREG EJSRPC RPC_EJS_INITSHUTDOWN \ + RPC_EJS_MISC RPC_EJS_SECURITY [MODULE::RPC_EJS_INITSHUTDOWN] INIT_FUNCTION = ejs_init_initshutdown 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 " diff --git a/source4/web_server/http.c b/source4/web_server/http.c index 3df9fcb25a..93d81ef1d0 100644 --- a/source4/web_server/http.c +++ b/source4/web_server/http.c @@ -467,7 +467,7 @@ static void http_setup_arrays(struct esp_state *esp) static jmp_buf ejs_exception_buf; static const char *exception_reason; -_PUBLIC_ void ejs_exception(const char *reason) +static void web_server_ejs_exception(const char *reason) { Ejs *ep = ejsPtr(0); if (ep) { @@ -480,7 +480,7 @@ _PUBLIC_ void ejs_exception(const char *reason) longjmp(ejs_exception_buf, -1); } #else -void ejs_exception(const char *reason) +static void web_server_ejs_exception(const char *reason) { DEBUG(0,("%s", reason)); smb_panic(reason); @@ -804,7 +804,7 @@ void http_process_input(struct websrv_context *web) edata->application_data, MPR_DEEP_COPY); } - smb_setup_ejs_functions(); + smb_setup_ejs_functions(web_server_ejs_exception); if (web->input.url == NULL) { http_error(web, 400, "You must specify a GET or POST request"); -- cgit