Author: jelmer
Date: 2006-03-21 07:08:08 +0000 (Tue, 21 Mar 2006)
New Revision: 14603

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=14603

Log:
Fix building of ejs modules as shared libs
Fix calling of ejs_exception() without requiring --export-dynamic

Modified:
   branches/SAMBA_4_0/source/build/smb_build/config_mk.pm
   branches/SAMBA_4_0/source/lib/ldb/config.mk
   branches/SAMBA_4_0/source/librpc/config.mk
   branches/SAMBA_4_0/source/scripting/ejs/config.mk
   branches/SAMBA_4_0/source/scripting/ejs/smbcalls.c
   branches/SAMBA_4_0/source/scripting/ejs/smbscript.c
   branches/SAMBA_4_0/source/web_server/http.c


Changeset:
Modified: branches/SAMBA_4_0/source/build/smb_build/config_mk.pm
===================================================================
--- branches/SAMBA_4_0/source/build/smb_build/config_mk.pm      2006-03-21 
06:53:49 UTC (rev 14602)
+++ branches/SAMBA_4_0/source/build/smb_build/config_mk.pm      2006-03-21 
07:08:08 UTC (rev 14603)
@@ -44,6 +44,8 @@
 
                "REQUIRED_SUBSYSTEMS"   => "list",
 
+               "ALIASES" => "list",
+
                "ENABLE"                => "bool",
 
                "OUTPUT_TYPE"           => "string",

Modified: branches/SAMBA_4_0/source/lib/ldb/config.mk
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/config.mk 2006-03-21 06:53:49 UTC (rev 
14602)
+++ branches/SAMBA_4_0/source/lib/ldb/config.mk 2006-03-21 07:08:08 UTC (rev 
14603)
@@ -9,8 +9,8 @@
 ################################################
 
 ################################################
-# 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 = \

Modified: branches/SAMBA_4_0/source/librpc/config.mk
===================================================================
--- branches/SAMBA_4_0/source/librpc/config.mk  2006-03-21 06:53:49 UTC (rev 
14602)
+++ branches/SAMBA_4_0/source/librpc/config.mk  2006-03-21 07:08:08 UTC (rev 
14603)
@@ -639,7 +639,7 @@
 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 @@
 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 @@
 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

Modified: branches/SAMBA_4_0/source/scripting/ejs/config.mk
===================================================================
--- branches/SAMBA_4_0/source/scripting/ejs/config.mk   2006-03-21 06:53:49 UTC 
(rev 14602)
+++ branches/SAMBA_4_0/source/scripting/ejs/config.mk   2006-03-21 07:08:08 UTC 
(rev 14603)
@@ -60,7 +60,9 @@
 
 #######################
 # Start LIBRARY smbcalls
-[SUBSYSTEM::smbcalls]
+[LIBRARY::smbcalls]
+SO_VERSION = 0
+VERSION = 0.0.1
 PRIVATE_PROTO_HEADER = proto.h
 OBJ_FILES = \
                smbcalls.o \

Modified: branches/SAMBA_4_0/source/scripting/ejs/smbcalls.c
===================================================================
--- branches/SAMBA_4_0/source/scripting/ejs/smbcalls.c  2006-03-21 06:53:49 UTC 
(rev 14602)
+++ branches/SAMBA_4_0/source/scripting/ejs/smbcalls.c  2006-03-21 07:08:08 UTC 
(rev 14603)
@@ -121,15 +121,23 @@
        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();

Modified: branches/SAMBA_4_0/source/scripting/ejs/smbscript.c
===================================================================
--- branches/SAMBA_4_0/source/scripting/ejs/smbscript.c 2006-03-21 06:53:49 UTC 
(rev 14602)
+++ branches/SAMBA_4_0/source/scripting/ejs/smbscript.c 2006-03-21 07:08:08 UTC 
(rev 14603)
@@ -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 @@
                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 "

Modified: branches/SAMBA_4_0/source/web_server/http.c
===================================================================
--- branches/SAMBA_4_0/source/web_server/http.c 2006-03-21 06:53:49 UTC (rev 
14602)
+++ branches/SAMBA_4_0/source/web_server/http.c 2006-03-21 07:08:08 UTC (rev 
14603)
@@ -467,7 +467,7 @@
 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 @@
        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 @@
                           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");

Reply via email to