You are viewing a plain text version of this content. The canonical link for it is here.
Posted to websh-cvs@tcl.apache.org by ro...@apache.org on 2009/05/22 12:13:36 UTC
svn commit: r777449 - in /tcl/websh/trunk: ./ doc/mod_websh/ src/
src/generic/ src/unix/ src/win/
Author: ronnie
Date: Fri May 22 10:13:35 2009
New Revision: 777449
URL: http://svn.apache.org/viewvc?rev=777449&view=rev
Log:
- dynamic linking of libwebsh.so|dll to websh binary and mod_websh.so
(check src/ChangeLog for individual commit messages)
Added:
tcl/websh/trunk/src/generic/modwebsh_cgi.h
Modified:
tcl/websh/trunk/CHANGES
tcl/websh/trunk/INSTALL
tcl/websh/trunk/README
tcl/websh/trunk/doc/mod_websh/README
tcl/websh/trunk/src/ChangeLog
tcl/websh/trunk/src/generic/dispatch.c
tcl/websh/trunk/src/generic/interpool.c
tcl/websh/trunk/src/generic/interpool.h
tcl/websh/trunk/src/generic/modwebsh.h
tcl/websh/trunk/src/generic/modwebsh_ap.c
tcl/websh/trunk/src/generic/modwebsh_cgi.c
tcl/websh/trunk/src/generic/request.c
tcl/websh/trunk/src/generic/request.h
tcl/websh/trunk/src/generic/request_ap.c
tcl/websh/trunk/src/generic/request_cgi.c
tcl/websh/trunk/src/generic/response_ap.c
tcl/websh/trunk/src/generic/response_cgi.c
tcl/websh/trunk/src/generic/web.c
tcl/websh/trunk/src/generic/webout.c
tcl/websh/trunk/src/generic/webout.h
tcl/websh/trunk/src/unix/Makefile.in
tcl/websh/trunk/src/win/Makefile
tcl/websh/trunk/src/win/README
Modified: tcl/websh/trunk/CHANGES
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/CHANGES?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/CHANGES (original)
+++ tcl/websh/trunk/CHANGES Fri May 22 10:13:35 2009
@@ -9,6 +9,8 @@
Trunk
-----
+- Dynamic linking of libwebsh.so|dll to websh binary and mod_websh.so
+
- Improved Cookie handling (deal with unusual format)
- Enabled mod_websh tests for Windows platform
Modified: tcl/websh/trunk/INSTALL
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/INSTALL?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/INSTALL (original)
+++ tcl/websh/trunk/INSTALL Fri May 22 10:13:35 2009
@@ -1,13 +1,12 @@
-Notes
-=====
-
-Please note that we use some GNU make extensions, so make sure that
-you try to compile Websh using a GNU version of make (or gmake) when
-compiling under UNIX.
-
+Unix
+====
Compile Websh 3.6
-=================
+-----------------
+
+Please note that we use some GNU make extensions, so make sure that
+you compile Websh using a GNU version of make (or gmake) when compiling
+under UNIX.
from the top level directory,
@@ -15,27 +14,56 @@
autoconf
./configure
make
+make test; # runs test suite on websh
+make apachetest; # runs test suite on mod_websh running within Apache
+make install
You may have to pass special options to configure, such as
---with-tcl to indicate where tclConfig.sh is located.
-
---with-tclinclude to indicate where the Tcl header files are.
-
---with-httpdinclude to indicate where the Apache header files are
-
---enable-threads if you plan to use it with Apache 2
- (don't forget to also compile Tcl with threads enabled).
+--with-tcl
+ to indicate where tclConfig.sh is located. (You can provide a
+ path to tcl where lib/tclConfig.sh and also include/tcl.h is
+ found so that you don't need to specify --with-tclinclude
+ separately)
+
+--with-tclinclude
+ to indicate where the Tcl header files are. (overwrites
+ --with-tcl for header files)
+
+--with-httpdinclude
+ to indicate where the Apache header files are
+
+--enable-threads
+ if you plan to use it with Apache 2 (don't forget to also
+ compile Tcl with threads enabled).
+
+--httpd
+ to indicate where the apache httpd binary resides (only
+ needed to compile Websh on Max OSX)
+
+--with-aprinclude
+--with-apuinclude
+ to indicate where the Apache portable runtime resides if
+ these are not included with the httpd header files
Websh provides the following targets
-====================================
+------------------------------------
websh3.6.<patch>
standalone tclsh with websh package already loaded
+ (dynamically linked to libwebsh3.6.<patch>.so and Tcl)
libwebsh3.6.<patch>.so
Tcl package shared object (provides package websh)
mod_websh3.6.<patch>.so
Apache module for Apache 1.3 and Apache 2.0 respectively
+ (dynamically linked to libwebsh3.6.<patch>.so and Tcl)
+
+
+
+Windows
+=======
+
+Please refer to the file src\win\README.
Modified: tcl/websh/trunk/README
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/README?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/README (original)
+++ tcl/websh/trunk/README Fri May 22 10:13:35 2009
@@ -21,7 +21,7 @@
2. Documentation
3. Compiling and installing Websh (Unix)
4. mod_websh: Websh as Apache Module (Unix)
- 5. Compiling and installing Websh (Windows XP)
+ 5. Compiling and installing Websh and mod_websh (Windows XP)
6. Support
@@ -72,21 +72,23 @@
./configure
make
make test
+ make apachetest
make install
Make will create three targets: websh3.6.<patch>, which is the standalone
-Websh application (dynamically linked to Tcl) and libwebsh3.6.<patch>.so,
-which is a TEA (Tcl Extension Architecture) shared object that can
-be dynamically loaded from within Tcl using [load libwebsh3.6.<patch>.so].
-Both provide the Tcl package websh. The third target is
-mod_websh3.6.<patch>.so, which is the Websh Apache module
+Websh application (dynamically linked to Tcl and libwebsh3.6.<patch>.so)
+and libwebsh3.6.<patch>.so, which is a TEA (Tcl Extension Architecture)
+compliant shared object that can be dynamically loaded from within Tcl
+using [load libwebsh3.6.<patch>.so]. Both provide the Tcl package
+websh. The third target is mod_websh3.6.<patch>.so (also dynamically
+linked to Tcl and libwebsh3.6.<patch>.so), which is the Websh Apache
+module.
If you have several versions of Tcl and Apache installed on your system,
you might want to specify which one should be used for Websh, e.g.
- ./configure --with-tcl=/usr/local/tcl8.3.4/lib \
- --with-tclinclude=/usr/local/tcl8.3.4/include \
- --with-httpdinclude=/usr/local/apache_1.3.29/include
+ ./configure --with-tcl=/usr/local/tcl8.4.19 \
+ --with-httpdinclude=/usr/local/httpd-2.0.63/include
Note that to compile mod_websh for Apache 2, the corresponding Tcl
library must be compiled using threads and threads should be enabled
@@ -99,16 +101,12 @@
./configure --prefix=/opt
-Note that Websh will install all files in <prefix>/websh and will then
-try to add symbolic links in <prefix>/bin and <prefix>/lib if these
-directories exist.
-
4. mod_websh: Websh as Apache Module
------------------------------------
Websh applications can both run in CGI mode and in mod_websh, the
-module for Apache 1.3 and Apache 2.0. In order to build mod_websh,
+module for Apache 1.3 to Apache 2.2. In order to build mod_websh,
you have to use the following configure option:
--with-httpdinclude=/path/to/apache/header/files
@@ -124,32 +122,18 @@
will compile and build mod_websh. Note that mod_websh3.6.<patch>.so will
also be compiled by default when 'make all' is invoked.
-In order to use mod_websh in your Apache web server, you have
-to do the following:
-
-1) cp mod_websh.so somewhere where Apache can find it.
- E.g. SERVER_ROOT/libexec/
-2) edit the httpd.conf file and add the following lines:
- LoadModule websh_module /path/to/apache/libexec/mod_websh.so
- AddHandler websh .ws3
-3) Optionally, you can specify a mod_websh configuration file using the
- following directive:
- WebshConfig /path/to/websh.conf
- This configuration file is primarily used to configure the interpreter
- classes (see documentation)
-4) HUP/restart httpd
-
-From now on, httpd will pass files ending in .ws3 to mod_websh.
+In order to use mod_websh in your Apache web server, please refer
+to the file doc/mod_websh/README
-A sample setup to server SSI-type HTML with Websh-snipplets and CGI-type
+A sample setup to serve SSI-type HTML with Websh-snipplets and CGI-type
scripts is found in doc/mod_websh and will be installed with the
'make install' command.
-5. Compiling and installing Websh (Windows XP)
-----------------------------------------------
+5. Compiling and installing Websh and mod_websh (Windows XP)
+------------------------------------------------------------
-Websh currently provides a Makefile forMicrosoft Visual Studio 6.0 nmake.
+Websh currently provides a Makefile for Microsoft Visual Studio 6.0 nmake.
Please refer to the file src/win/README for details.
Modified: tcl/websh/trunk/doc/mod_websh/README
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/doc/mod_websh/README?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/doc/mod_websh/README (original)
+++ tcl/websh/trunk/doc/mod_websh/README Fri May 22 10:13:35 2009
@@ -37,7 +37,7 @@
websh.exe (Windows)
websh<version>.exe (Windows)
-- Tcl extension (to be loaded into a Tclsh):
+- Tcl extension (loaded by Websh and loadable into a plain Tclsh):
libwebsh.so (Unix symbolic link)
libwebsh<version>.so (Unix)
websh.dll (Windows)
@@ -46,5 +46,7 @@
Note
====
-To run the Apache module, only modules/mod_websh.so (or
-mod_websh<version>.so respectively) is needed.
+To run the Apache module, modules/mod_websh.so (or
+mod_websh<version>.so respectively), libwebsh.so (or
+libwebsh<version>.so respectively), and the Tcl installation is needed.
+
Modified: tcl/websh/trunk/src/ChangeLog
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/ChangeLog?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/src/ChangeLog (original)
+++ tcl/websh/trunk/src/ChangeLog Fri May 22 10:13:35 2009
@@ -1,6 +1,86 @@
+2009-05-22 Brunner Ronnie <ro...@netcetera.ch>
+ * <all changes>:
+ - allow dynamic linking of libwebsh.so|dll to websh, websh.exe and
+ mod_websh.so
+ * doc_mod_websh/README, INSTALL, README, src/win/README:
+ - adapted to new dynamic linking
+ - reduced some redundancy
+ - documented (n)make apachetest target
+ * src/unix/Makefile.in, src/win/Makefile:
+ - dynamic linking of libwebsh.so|dll to websh, websh.exe and
+ mod_websh.so
+ * src/generic/modwebsh_cgi.h:
+ - created for ApFuncs: a struct with pointers to the
+ mod_websh implementations of various websh commands that
+ differ from the CGI implementation.
+ * src/generic/modwebsh_cgi.c:
+ - implemented a switch in all functions according to ApFuncs
+ content -> call either mod_websh or CGI implementation.
+ * src/generic/request_cgi.c:
+ - implemented a switch in all functions according to ApFuncs
+ content -> call either mod_websh or CGI implementation.
+ - changed signature in some funtcions to include interp to
+ allow mod_websh / CGI switch depending on context (ApFuncs)
+ * src/generic/displatch.c:
+ - added interp as parameter to requestGetDefaultChannelName
+ to allow mod_websh / CGI switch depending on context (ApFuncs)
+ * src/generic/response_ap.c:
+ - changed isDefaultResponseObj to isDefaultResponseObj_AP
+ to distinguish functions since with dynamic linking, both
+ versions CGI and mod_websh are present in the code.
+ - added interp as parameter to isDefaultResponseObj_AP
+ to allow mod_websh / CGI switch depending on context (ApFuncs)
+ * src/generic/request_ap.c:
+ - changed requestGetDefaultChannelName to
+ requestGetDefaultChannelName_AP and requestFillRequestValues to
+ requestFillRequestValues_AP to distinguish functions since with
+ dynamic linking, both versions CGI and mod_websh are present in
+ the code.
+ - remove duplicate check for requestData->requestIsInitialized
+ * src/generic/interpool.c:
+ - setup apFuncs function pointers for mod_websh interps and set
+ the struct as Tcl AssocData to the interp (Note: this is how at
+ runtime, Websh distinguishes whether the CGI or the mod_websh
+ implementation of certain functions must be invoked)
+ * src/generic/interpool.h:
+ - define prototypes for createApFuncs and destroyApFuncs
+ * src/generic/response_cgi.c:
+ - implemented a switch in all functions according to ApFuncs
+ content -> call either mod_websh or CGI implementation.
+ - added interp as parameter to isDefaultResponseObj
+ to allow mod_websh / CGI switch depending on context (ApFuncs)
+ * src/generic/modwebsh_ap.c:
+ - changed various functions from <func> to <func>_AP to allow
+ mod_websh / CGI switch depending on context (ApFuncs)
+ - removed modwebsh_createcmd, since it's now redundant to the CGI
+ implementation.
+ * src/generic/request.c:
+ - call requestGetDefaultChannelName with interp as parameter
+ * src/generic/request.h:
+ - changed prototypes for requestGetDefaultChannelName and
+ requestGetDefaultOutChannelName: both now include interp as
+ parameter
+ * src/generic/modwebsh.h:
+ - changed prototypes from <func> to <func>_AP for mod_websh
+ implementation
+ * src/generic/webout.c:
+ - call isDefaultResponseObj and requestGetDefaultOutChannelName
+ with interp as argument
+ * src/generic/webout.h:
+ - changed prototype of isDefaultResponseObj (added interp as
+ argument)
+ * src/generic/web.c:
+ - added prototype of modwebsh_createcmd
+
+2009-05-22 Brunner Ronnie <ro...@netcetera.ch>
+ * src/apachetests/test/headers.test:
+ - proper URL in header-1.1 test
+
2009-04-16 Brunner Ronnie <ro...@netcetera.ch>
* src/generic/cookie.ws3:
- improved Cookie handling (deal with unusual formats)
+ * src/tests/cookiecontext.test:
+ - added test for the above fix
2009-04-14 Brunner Ronnie <ro...@netcetera.ch>
* src/unix/Makefile.in:
Modified: tcl/websh/trunk/src/generic/dispatch.c
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/generic/dispatch.c?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/src/generic/dispatch.c (original)
+++ tcl/websh/trunk/src/generic/dispatch.c Fri May 22 10:13:35 2009
@@ -24,8 +24,6 @@
#define FORM_MULTIPART_LEN 19
#define FORM_DEFAULT_TYPE FORM_URLENCODED
-Tcl_Obj *requestGetDefaultChannelName();
-
int parsePostData(Tcl_Interp * interp, Tcl_Obj * name,
Tcl_Obj * type, Tcl_Obj * len, RequestData * requestData);
@@ -195,7 +193,7 @@
Tcl_Obj *tmp = NULL;
- tmp = requestGetDefaultChannelName();
+ tmp = requestGetDefaultChannelName(interp);
Tcl_IncrRefCount(tmp);
Modified: tcl/websh/trunk/src/generic/interpool.c
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/generic/interpool.c?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/src/generic/interpool.c (original)
+++ tcl/websh/trunk/src/generic/interpool.c Fri May 22 10:13:35 2009
@@ -110,6 +110,7 @@
int result = 0;
LogPlugIn *logtoap = NULL;
Tcl_Obj *code = NULL;
+ ApFuncs *apFuncs = NULL;
WebInterp *webInterp = (WebInterp *) Tcl_Alloc(sizeof(WebInterp));
@@ -135,6 +136,12 @@
/* now register here all websh modules */
result = Tcl_Init(webInterp->interp);
/* checkme: test result */
+
+ apFuncs = Tcl_GetAssocData(conf->mainInterp, WEB_APFUNCS_ASSOC_DATA, NULL);
+ if (apFuncs == NULL)
+ return NULL;
+ Tcl_SetAssocData(webInterp->interp, WEB_APFUNCS_ASSOC_DATA, NULL, (ClientData *) apFuncs);
+
result = Websh_Init(webInterp->interp);
/* also register the destrcutor, etc. functions, passing webInterp as
@@ -594,6 +601,7 @@
LogPlugIn *logtoap = NULL;
Tcl_Interp *mainInterp = Tcl_CreateInterp();
+ ApFuncs *apFuncs;
if (mainInterp == NULL)
return NULL;
@@ -611,6 +619,13 @@
}
#endif
+ apFuncs = createApFuncs();
+ if (apFuncs == NULL) {
+ Tcl_DeleteInterp(mainInterp);
+ return NULL;
+ }
+ Tcl_SetAssocData(mainInterp, WEB_APFUNCS_ASSOC_DATA, destroyApFuncs, (ClientData *) apFuncs);
+
/* standard Init */
if (Tcl_Init(mainInterp) == TCL_ERROR) {
Tcl_DeleteInterp(mainInterp);
@@ -774,3 +789,27 @@
Tcl_DecrRefCount(objPtr);
return TCL_ERROR;
}
+
+ApFuncs *createApFuncs() {
+ ApFuncs *apFuncs = (ApFuncs *) Tcl_Alloc(sizeof(ApFuncs));
+ if (apFuncs == NULL)
+ return NULL;
+ apFuncs->createDefaultResponseObj = createDefaultResponseObj_AP;
+ apFuncs->isDefaultResponseObj = isDefaultResponseObj_AP;
+ apFuncs->requestGetDefaultChannelName = requestGetDefaultChannelName_AP;
+ apFuncs->requestGetDefaultOutChannelName = requestGetDefaultOutChannelName_AP;
+ apFuncs->requestFillRequestValues = requestFillRequestValues_AP;
+ apFuncs->Web_Initializer = Web_Initializer_AP;
+ apFuncs->Web_Finalizer = Web_Finalizer_AP;
+ apFuncs->Web_Finalize = Web_Finalize_AP;
+ apFuncs->Web_InterpCfg = Web_InterpCfg_AP;
+ apFuncs->Web_InterpClassCfg = Web_InterpClassCfg_AP;
+ apFuncs->Web_MainEval = Web_MainEval_AP;
+ apFuncs->Web_ConfigPath = Web_ConfigPath_AP;
+ return apFuncs;
+}
+
+void destroyApFuncs(ClientData apFuncs, Tcl_Interp * interp) {
+ if (apFuncs != NULL)
+ Tcl_Free((char *) apFuncs);
+}
Modified: tcl/websh/trunk/src/generic/interpool.h
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/generic/interpool.h?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/src/generic/interpool.h (original)
+++ tcl/websh/trunk/src/generic/interpool.h Fri May 22 10:13:35 2009
@@ -23,6 +23,7 @@
#include "modwebsh.h"
#include "mod_websh.h"
+#include "modwebsh_cgi.h"
/* ----------------------------------------------------------------------------
* the interp-pool is kept in a hash table where
@@ -145,4 +146,7 @@
void deleteInterpClass(WebInterpClass * webInterpClass);
int readWebInterpCode(WebInterp * wi, char *filename);
+ApFuncs* createApFuncs();
+void destroyApFuncs(ClientData apFuncs, Tcl_Interp *interp);
+
#endif
Modified: tcl/websh/trunk/src/generic/modwebsh.h
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/generic/modwebsh.h?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/src/generic/modwebsh.h (original)
+++ tcl/websh/trunk/src/generic/modwebsh.h Fri May 22 10:13:35 2009
@@ -14,29 +14,62 @@
*/
#include "tcl.h"
-#include "cfg.h"
+#include "webout.h"
#ifndef MODWEBSH_H
#define MODWEBSH_H
-int Web_Initializer(ClientData clientData,
+/* declarations for command registration */
+
+int __declspec(dllexport) Web_Initializer(ClientData clientData,
+ Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[]);
+
+int __declspec(dllexport) Web_Finalizer(ClientData clientData,
+ Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[]);
+
+int __declspec(dllexport) Web_Finalize(ClientData clientData,
+ Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[]);
+
+int __declspec(dllexport) Web_MainEval(ClientData clientData,
+ Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[]);
+
+int __declspec(dllexport) Web_InterpCfg(ClientData clientData,
+ Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[]);
+
+int __declspec(dllexport) Web_InterpClassCfg(ClientData clientData,
+ Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[]);
+
+/* declarations for local (mod_websh) implementation */
+
+int Web_Initializer_AP(ClientData clientData,
Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[]);
-int Web_Finalizer(ClientData clientData,
+
+int Web_Finalizer_AP(ClientData clientData,
Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[]);
-int Web_Finalize(ClientData clientData,
+int Web_Finalize_AP(ClientData clientData,
Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[]);
-int Web_MainEval(ClientData clientData,
+int Web_MainEval_AP(ClientData clientData,
Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[]);
-int Web_InterpCfg(ClientData clientData,
+int Web_InterpCfg_AP(ClientData clientData,
Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[]);
-int Web_InterpClassCfg(ClientData clientData,
+int Web_InterpClassCfg_AP(ClientData clientData,
Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[]);
-int modwebsh_createcmd(Tcl_Interp * interp);
+ResponseObj* createDefaultResponseObj_AP(Tcl_Interp * interp);
+
+int isDefaultResponseObj_AP(Tcl_Interp * interp, char *name);
+
+Tcl_Obj* requestGetDefaultChannelName_AP(Tcl_Interp * interp);
+
+char* requestGetDefaultOutChannelName_AP(Tcl_Interp * interp);
+
+int requestFillRequestValues_AP(Tcl_Interp *interp, RequestData *requestData);
+
+int Web_ConfigPath_AP(Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
#endif
Modified: tcl/websh/trunk/src/generic/modwebsh_ap.c
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/generic/modwebsh_ap.c?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/src/generic/modwebsh_ap.c (original)
+++ tcl/websh/trunk/src/generic/modwebsh_ap.c Fri May 22 10:13:35 2009
@@ -22,7 +22,7 @@
/* -------------------------------------------------------------------------
* Web_Initializer -- if request counter is 0, eval the code
* ------------------------------------------------------------------------- */
-int Web_Initializer(ClientData clientData,
+int Web_Initializer_AP(ClientData clientData,
Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[])
{
@@ -77,7 +77,7 @@
/* ----------------------------------------------------------------------------
* Web_Finalizer -- register the destructor (to be called when WebInterp dies)
* ------------------------------------------------------------------------- */
-int Web_Finalizer(ClientData clientData,
+int Web_Finalizer_AP(ClientData clientData,
Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[])
{
@@ -125,7 +125,7 @@
/* -------------------------------------------------------------------------
* Web_Finalize -- call registered finalizers, in turn
* ------------------------------------------------------------------------- */
-int Web_Finalize(ClientData clientData,
+int Web_Finalize_AP(ClientData clientData,
Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[])
{
@@ -186,7 +186,7 @@
/* -------------------------------------------------------------------------
* Web_InterpCfg -- set WebInterp properties
* ------------------------------------------------------------------------- */
-int Web_InterpCfg(ClientData clientData,
+int Web_InterpCfg_AP(ClientData clientData,
Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[])
{
@@ -271,7 +271,7 @@
/* ----------------------------------------------------------------------------
* Web_InterpClassCfg -- set WebInterpClass properties
* ------------------------------------------------------------------------- */
-int Web_InterpClassCfg(ClientData clientData,
+int Web_InterpClassCfg_AP(ClientData clientData,
Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[])
{
@@ -362,7 +362,7 @@
/* ----------------------------------------------------------------------------
* Web_MainEval -- eval in main interp
* ------------------------------------------------------------------------- */
-int Web_MainEval(ClientData clientData,
+int Web_MainEval_AP(ClientData clientData,
Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[])
{
@@ -442,7 +442,7 @@
* Web_ConfigPath -- (sub)command in pool interp (called from Web_Cfg)
* ------------------------------------------------------------------------- */
-int Web_ConfigPath(Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[]) {
+int Web_ConfigPath_AP(Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[]) {
/* these options should be in sync with the options in Web_Cfg
* not the order or anything, but the actual text strings */
@@ -500,13 +500,3 @@
}
return TCL_OK;
}
-
-
-
-/* -------------------------------------------------------------------------
- * init -- fake in mod_websh case ! see creation of WebInterp
- * ------------------------------------------------------------------------- */
-int modwebsh_createcmd(Tcl_Interp * interp)
-{
- return TCL_OK;
-}
Modified: tcl/websh/trunk/src/generic/modwebsh_cgi.c
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/generic/modwebsh_cgi.c?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/src/generic/modwebsh_cgi.c (original)
+++ tcl/websh/trunk/src/generic/modwebsh_cgi.c Fri May 22 10:13:35 2009
@@ -15,16 +15,20 @@
#include "tcl.h"
#include "macros.h"
+#include "modwebsh_cgi.h"
/* ----------------------------------------------------------------------------
* Web_Initializer -- just eval the code
* ------------------------------------------------------------------------- */
-int Web_Initializer(ClientData clientData,
+int __declspec(dllexport) Web_Initializer(ClientData clientData,
Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[])
{
-
int res = 0;
+ ApFuncs *apFuncs = Tcl_GetAssocData(interp, WEB_APFUNCS_ASSOC_DATA, NULL);
+ if (apFuncs != NULL)
+ return apFuncs->Web_Initializer(clientData, interp, objc, objv);
+
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "code");
return TCL_ERROR;
@@ -51,12 +55,16 @@
/* ----------------------------------------------------------------------------
* Web_Finalizer -- just eval the code
* ------------------------------------------------------------------------- */
-int Web_Finalizer(ClientData clientData,
+int __declspec(dllexport) Web_Finalizer(ClientData clientData,
Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[])
{
int res = 0;
+ ApFuncs *apFuncs = Tcl_GetAssocData(interp, WEB_APFUNCS_ASSOC_DATA, NULL);
+ if (apFuncs != NULL)
+ return apFuncs->Web_Finalizer(clientData, interp, objc, objv);
+
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "code");
return TCL_ERROR;
@@ -72,9 +80,12 @@
/* ----------------------------------------------------------------------------
* Web_Finalizer -- just return
* ------------------------------------------------------------------------- */
-int Web_Finalize(ClientData clientData,
+int __declspec(dllexport) Web_Finalize(ClientData clientData,
Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[])
{
+ ApFuncs *apFuncs = Tcl_GetAssocData(interp, WEB_APFUNCS_ASSOC_DATA, NULL);
+ if (apFuncs != NULL)
+ return apFuncs->Web_Finalize(clientData, interp, objc, objv);
return TCL_OK;
}
@@ -82,9 +93,12 @@
/* ----------------------------------------------------------------------------
* Web_InterpClassCfg -- just return
* ------------------------------------------------------------------------- */
-int Web_InterpClassCfg(ClientData clientData,
+int __declspec(dllexport) Web_InterpClassCfg(ClientData clientData,
Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[])
{
+ ApFuncs *apFuncs = Tcl_GetAssocData(interp, WEB_APFUNCS_ASSOC_DATA, NULL);
+ if (apFuncs != NULL)
+ return apFuncs->Web_InterpClassCfg(clientData, interp, objc, objv);
return TCL_OK;
}
@@ -92,9 +106,12 @@
/* ----------------------------------------------------------------------------
* Web_InterpCfg -- just return
* ------------------------------------------------------------------------- */
-int Web_InterpCfg(ClientData clientData,
+int __declspec(dllexport) Web_InterpCfg(ClientData clientData,
Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[])
{
+ ApFuncs *apFuncs = Tcl_GetAssocData(interp, WEB_APFUNCS_ASSOC_DATA, NULL);
+ if (apFuncs != NULL)
+ return apFuncs->Web_InterpCfg(clientData, interp, objc, objv);
return TCL_OK;
}
@@ -102,9 +119,12 @@
/* ----------------------------------------------------------------------------
* Web_MainEval -- just return
* ------------------------------------------------------------------------- */
-int Web_MainEval(ClientData clientData,
+int __declspec(dllexport) Web_MainEval(ClientData clientData,
Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[])
{
+ ApFuncs *apFuncs = Tcl_GetAssocData(interp, WEB_APFUNCS_ASSOC_DATA, NULL);
+ if (apFuncs != NULL)
+ return apFuncs->Web_MainEval(clientData, interp, objc, objv);
return TCL_OK;
}
@@ -136,6 +156,10 @@
int index;
Tcl_Obj *res = NULL;
+ ApFuncs *apFuncs = Tcl_GetAssocData(interp, WEB_APFUNCS_ASSOC_DATA, NULL);
+ if (apFuncs != NULL)
+ return apFuncs->Web_ConfigPath(interp, objc, objv);
+
if (Tcl_GetIndexFromObj(interp, objv[1], subCmd, "subcommand", 0, &index)
!= TCL_OK) {
/* let the caller handle the web::config command */
@@ -179,6 +203,10 @@
* ------------------------------------------------------------------------- */
int modwebsh_createcmd(Tcl_Interp * interp)
{
+ if (NULL != Tcl_GetAssocData(interp, WEB_APFUNCS_ASSOC_DATA, NULL)) {
+ /* no need to do that if we're in mod_websh mode */
+ return TCL_OK;
+ }
Tcl_CreateObjCommand(interp, "web::initializer",
Web_Initializer, NULL, NULL);
Added: tcl/websh/trunk/src/generic/modwebsh_cgi.h
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/generic/modwebsh_cgi.h?rev=777449&view=auto
==============================================================================
--- tcl/websh/trunk/src/generic/modwebsh_cgi.h (added)
+++ tcl/websh/trunk/src/generic/modwebsh_cgi.h Fri May 22 10:13:35 2009
@@ -0,0 +1,40 @@
+/*
+ * modwebsh_cgi.h -- additional header file for modwebsh
+ * nca-073-9
+ *
+ * Copyright (c) 1996-2000 by Netcetera AG.
+ * Copyright (c) 2009 by Apache Software Foundation.
+ * All rights reserved.
+ *
+ * See the file "license.terms" for information on usage and
+ * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * @(#) $Id: modwebsh.h 322352 2002-09-11 09:14:06Z ronnie $
+ *
+ */
+
+#include "webout.h"
+
+#ifndef MODWEBSH_CGI_H
+#define MODWEBSH_CGI_H
+
+typedef struct
+{
+ ResponseObj * (*createDefaultResponseObj) (Tcl_Interp * interp);
+ int (*isDefaultResponseObj) (Tcl_Interp * interp, char *name);
+ Tcl_Obj* (*requestGetDefaultChannelName) (Tcl_Interp * interp);
+ char* (*requestGetDefaultOutChannelName) (Tcl_Interp * interp);
+ int (*requestFillRequestValues) (Tcl_Interp *interp, RequestData *requestData);
+ int (*Web_Initializer) (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
+ int (*Web_Finalizer) (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
+ int (*Web_Finalize) (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
+ int (*Web_InterpCfg) (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
+ int (*Web_InterpClassCfg) (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
+ int (*Web_MainEval) (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
+ int (*Web_ConfigPath) (Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
+}
+ApFuncs;
+
+#define WEB_APFUNCS_ASSOC_DATA "web::apfuncs"
+
+#endif
Modified: tcl/websh/trunk/src/generic/request.c
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/generic/request.c?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/src/generic/request.c (original)
+++ tcl/websh/trunk/src/generic/request.c Fri May 22 10:13:35 2009
@@ -472,7 +472,7 @@
switch ((enum params) opt) {
case DEFAULTCHANNELNAME:
- Tcl_SetObjResult(interp, requestGetDefaultChannelName());
+ Tcl_SetObjResult(interp, requestGetDefaultChannelName(interp));
return TCL_OK;
break;
case REQUESTRESET:
Modified: tcl/websh/trunk/src/generic/request.h
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/generic/request.h?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/src/generic/request.h (original)
+++ tcl/websh/trunk/src/generic/request.h Fri May 22 10:13:35 2009
@@ -193,8 +193,8 @@
/* in CGI case: implemented in request_cgi.c
* in httpd case: implemented in mod_websh.c */
-Tcl_Obj *requestGetDefaultChannelName();
-char *requestGetDefaultOutChannelName();
+Tcl_Obj *requestGetDefaultChannelName(Tcl_Interp *interp);
+char *requestGetDefaultOutChannelName(Tcl_Interp *interp);
int requestFillRequestValues(Tcl_Interp * interp, RequestData * requestData);
Modified: tcl/websh/trunk/src/generic/request_ap.c
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/generic/request_ap.c?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/src/generic/request_ap.c (original)
+++ tcl/websh/trunk/src/generic/request_ap.c Fri May 22 10:13:35 2009
@@ -28,19 +28,19 @@
/* ----------------------------------------------------------------------------
* web::request -channel: where input for request obj comes from
* ------------------------------------------------------------------------- */
-Tcl_Obj *requestGetDefaultChannelName()
+Tcl_Obj *requestGetDefaultChannelName_AP(Tcl_Interp * interp)
{
return Tcl_NewStringObj(APCHANNEL, -1);
}
/* default output channel */
-char *requestGetDefaultOutChannelName()
+char *requestGetDefaultOutChannelName_AP(Tcl_Interp * interp)
{
return APCHANNEL;
}
-int requestFillRequestValues(Tcl_Interp * interp, RequestData * requestData)
+int requestFillRequestValues_AP(Tcl_Interp * interp, RequestData * requestData)
{
request_rec *r = NULL;
@@ -56,10 +56,6 @@
Tcl_Obj *valo = NULL;
- if (requestData->requestIsInitialized)
- return TCL_OK;
- requestData->requestIsInitialized = 1;
-
if (interp == NULL)
return TCL_ERROR;
Modified: tcl/websh/trunk/src/generic/request_cgi.c
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/generic/request_cgi.c?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/src/generic/request_cgi.c (original)
+++ tcl/websh/trunk/src/generic/request_cgi.c Fri May 22 10:13:35 2009
@@ -20,19 +20,28 @@
#include "hashutl.h"
#include "webutl.h"
#include "request.h"
+#include "modwebsh_cgi.h"
/* ----------------------------------------------------------------------------
* web::request -channel: where input for request obj comes from
* ------------------------------------------------------------------------- */
-Tcl_Obj *requestGetDefaultChannelName()
+Tcl_Obj *requestGetDefaultChannelName(Tcl_Interp * interp)
{
+ ApFuncs *apFuncs = Tcl_GetAssocData(interp, WEB_APFUNCS_ASSOC_DATA, NULL);
+ if (apFuncs != NULL)
+ return apFuncs->requestGetDefaultChannelName(interp);
+
return Tcl_NewStringObj("stdin", 5);
}
/* default output channel */
-char *requestGetDefaultOutChannelName()
+char *requestGetDefaultOutChannelName(Tcl_Interp * interp)
{
+ ApFuncs *apFuncs = Tcl_GetAssocData(interp, WEB_APFUNCS_ASSOC_DATA, NULL);
+ if (apFuncs != NULL)
+ return apFuncs->requestGetDefaultOutChannelName(interp);
+
return CGICHANNEL;
}
@@ -42,5 +51,12 @@
if (requestData->requestIsInitialized)
return TCL_OK;
requestData->requestIsInitialized = 1;
+
+ {
+ ApFuncs *apFuncs = Tcl_GetAssocData(interp, WEB_APFUNCS_ASSOC_DATA, NULL);
+ if (apFuncs != NULL)
+ return apFuncs->requestFillRequestValues(interp, requestData);
+ }
+
return Tcl_Eval(interp, "web::cgi::copyenv");
}
Modified: tcl/websh/trunk/src/generic/response_ap.c
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/generic/response_ap.c?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/src/generic/response_ap.c (original)
+++ tcl/websh/trunk/src/generic/response_ap.c Fri May 22 10:13:35 2009
@@ -148,7 +148,7 @@
/* ----------------------------------------------------------------------------
* createDefaultResponseObj
* ------------------------------------------------------------------------- */
-ResponseObj *createDefaultResponseObj(Tcl_Interp * interp)
+ResponseObj *createDefaultResponseObj_AP(Tcl_Interp * interp)
{
return createResponseObj(interp, APCHANNEL, &apHeaderHandler);
}
@@ -156,7 +156,7 @@
/* ----------------------------------------------------------------------------
* isDefaultResponseObj
* ------------------------------------------------------------------------- */
-int isDefaultResponseObj(char *name)
+int isDefaultResponseObj_AP(Tcl_Interp * interp, char *name)
{
return !strcmp(name, APCHANNEL);
}
Modified: tcl/websh/trunk/src/generic/response_cgi.c
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/generic/response_cgi.c?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/src/generic/response_cgi.c (original)
+++ tcl/websh/trunk/src/generic/response_cgi.c Fri May 22 10:13:35 2009
@@ -15,21 +15,29 @@
#include "tcl.h"
#include "hashutl.h"
-#include "webout.h"
#include "request.h"
+#include "modwebsh_cgi.h"
/* ----------------------------------------------------------------------------
* createDefaultResponseObj
* ------------------------------------------------------------------------- */
ResponseObj *createDefaultResponseObj(Tcl_Interp * interp)
{
+ ApFuncs *apFuncs = Tcl_GetAssocData(interp, WEB_APFUNCS_ASSOC_DATA, NULL);
+ if (apFuncs != NULL)
+ return apFuncs->createDefaultResponseObj(interp);
+
return createResponseObj(interp, CGICHANNEL, &objectHeaderHandler);
}
/* ----------------------------------------------------------------------------
* isDefaultResponseObj
* ------------------------------------------------------------------------- */
-int isDefaultResponseObj(char *name)
+int isDefaultResponseObj(Tcl_Interp * interp, char *name)
{
+ ApFuncs *apFuncs = Tcl_GetAssocData(interp, WEB_APFUNCS_ASSOC_DATA, NULL);
+ if (apFuncs != NULL)
+ return apFuncs->isDefaultResponseObj(interp, name);
+
return !strcmp(name, CGICHANNEL);
}
Modified: tcl/websh/trunk/src/generic/web.c
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/generic/web.c?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/src/generic/web.c (original)
+++ tcl/websh/trunk/src/generic/web.c Fri May 22 10:13:35 2009
@@ -19,6 +19,8 @@
#include <stdio.h>
#include "messages.h"
+int modwebsh_createcmd(Tcl_Interp * interp);
+
/* ----------------------------------------------------------------------------
* init --
* ------------------------------------------------------------------------- */
Modified: tcl/websh/trunk/src/generic/webout.c
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/generic/webout.c?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/src/generic/webout.c (original)
+++ tcl/websh/trunk/src/generic/webout.c Fri May 22 10:13:35 2009
@@ -288,7 +288,7 @@
* with our special createDefaultResponseObj function ...
*/
- if (isDefaultResponseObj(tname))
+ if (isDefaultResponseObj(interp, tname))
responseObj = createDefaultResponseObj(interp);
else
responseObj = getResponseObj(interp, outData, tname);
@@ -334,7 +334,7 @@
name = Tcl_GetString(objv[2]);
/* we have to find the new channel */
if (!strcmp(name, "default")) {
- name = (char *) requestGetDefaultOutChannelName();
+ name = (char *) requestGetDefaultOutChannelName(interp);
}
responseObj =
getResponseObj(interp, outData, name);
Modified: tcl/websh/trunk/src/generic/webout.h
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/generic/webout.h?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/src/generic/webout.h (original)
+++ tcl/websh/trunk/src/generic/webout.h Fri May 22 10:13:35 2009
@@ -100,7 +100,7 @@
/* cgi/apache dependent prototypes */
ResponseObj *createDefaultResponseObj(Tcl_Interp * interp);
-int isDefaultResponseObj(char *name);
+int isDefaultResponseObj(Tcl_Interp * interp, char *name);
Modified: tcl/websh/trunk/src/unix/Makefile.in
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/unix/Makefile.in?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/src/unix/Makefile.in (original)
+++ tcl/websh/trunk/src/unix/Makefile.in Fri May 22 10:13:35 2009
@@ -19,7 +19,7 @@
SCRIPT_SOURCES = ../generic/context.tcl ../generic/script.ws3 ../generic/cookie.ws3 ../generic/sessctx.ws3
-web_OBJECTS_gen = args.o \
+web_OBJECTS = args.o \
cfg.o \
checksum.o \
command.o \
@@ -51,9 +51,8 @@
weboutint.o \
webutl.o \
webutlcmd.o \
- varchannel.o
-
-web_OBJECTS_cgi = modwebsh_cgi.o \
+ varchannel.o \
+ modwebsh_cgi.o \
request_cgi.o \
response_cgi.o
@@ -65,10 +64,6 @@
request_ap.o \
response_ap.o
-
-web_OBJECTS = $(web_OBJECTS_gen) $(web_OBJECTS_cgi)
-web_ap_OBJECTS := $(web_OBJECTS_gen) $(web_OBJECTS_ap)
-
OBJECTS = $(web_OBJECTS)
web_LIB_FILE = @web_LIB_FILE@
@@ -268,28 +263,33 @@
mod_websh.so: mod_websh$(MODULE_LIB_SUFFIX)
-websh$(VERSION): tclAppInit.$(OBJEXT) $(web_OBJECTS)
- $(CC) @LDFLAGS@ tclAppInit.$(OBJEXT) $(web_OBJECTS) \
- $(TCL_LIB_SPEC) $(TCL_STUB_LIB_SPEC) $(TCL_LIBS) $(TCL_LD_FLAGS) -o websh$(VERSION)
-
-mod_websh$(MODULE_LIB_SUFFIX): $(web_ap_OBJECTS)
- $(SHLIB_LD_CURRENT) -o mod_websh$(MODULE_LIB_SUFFIX) $(web_ap_OBJECTS) $(TCL_LIB_SPEC) $(TCL_STUB_LIB_SPEC)
-
-mod_websh$(UNSHARED_LIB_SUFFIX): $(web_ap_OBJECTS)
- $(STLIB_LD) $(TCL_LD_FLAGS) -o mod_websh$(UNSHARED_LIB_SUFFIX) $(web_ap_OBJECTS)
+websh$(VERSION): tclAppInit.$(OBJEXT) $(web_LIB_FILE)
+ $(CC) @LDFLAGS@ tclAppInit.$(OBJEXT) $(web_LIB_FILE) \
+ $(TCL_LIB_SPEC) $(TCL_STUB_LIB_SPEC) $(TCL_LIBS) $(TCL_LD_FLAGS) \
+ -o websh$(VERSION)
+
+mod_websh$(MODULE_LIB_SUFFIX): $(web_OBJECTS_ap) $(web_LIB_FILE)
+ $(SHLIB_LD_CURRENT) -o mod_websh$(MODULE_LIB_SUFFIX) \
+ $(web_OBJECTS_ap) $(web_LIB_FILE) $(TCL_LIB_SPEC) $(TCL_STUB_LIB_SPEC)
+
+mod_websh$(UNSHARED_LIB_SUFFIX): $(web_OBJECTS_ap) $(web_OBJECTS)
+ $(STLIB_LD) $(TCL_LD_FLAGS) -o mod_websh$(UNSHARED_LIB_SUFFIX) \
+ $(web_OBJECTS_ap) $(web_OBJECTS)
pure: websh$(VERSION).pure
-websh$(VERSION).pure: tclAppInit.$(OBJEXT) $(web_OBJECTS)
- purify $(CC) @LDFLAGS@ tclAppInit.$(OBJEXT) $(web_OBJECTS) \
- $(TCL_LIB_SPEC) $(TCL_STUB_LIB_SPEC) $(TCL_LD_FLAGS) -o websh$(VERSION).pure
+websh$(VERSION).pure: tclAppInit.$(OBJEXT) $(web_LIB_FILE)
+ purify $(CC) @LDFLAGS@ tclAppInit.$(OBJEXT) $(web_LIB_FILE) \
+ $(TCL_LIB_SPEC) $(TCL_STUB_LIB_SPEC) $(TCL_LIBS) $(TCL_LD_FLAGS) \
+ -o websh$(VERSION).pure
-rm -f *_pure_*.o
cov: websh$(VERSION).cov
-websh$(VERSION).cov: tclAppInit.$(OBJEXT) $(web_OBJECTS)
- purecov $(CC) @LDFLAGS@ tclAppInit.$(OBJEXT) $(web_OBJECTS) \
- $(TCL_LIB_SPEC) $(TCL_STUB_LIB_SPEC) $(TCL_LD_FLAGS) -o websh$(VERSION).cov
+websh$(VERSION).cov: tclAppInit.$(OBJEXT) $(web_LIB_FILE)
+ purecov $(CC) @LDFLAGS@ tclAppInit.$(OBJEXT) $(web_LIB_FILE) \
+ $(TCL_LIB_SPEC) $(TCL_STUB_LIB_SPEC) $(TCL_LIBS) $(TCL_LD_FLAGS) \
+ -o websh$(VERSION).cov
-rm -f *_pure_*.o
.SUFFIXES: .c .o .obj
@@ -308,7 +308,7 @@
-rm -f *~ ../*~ ../*/*~
-rm -f ../tests/locktest.*
-rm -rf ../apachetests/logs ../apachetest/conf/server.conf ../apachetest/conf/websh.conf
- -rm -f $(web_OBJECTS) $(web_ap_OBJECTS) mod_websh$(SHARED_LIB_SUFFIX) mod_websh$(UNSHARED_LIB_SUFFIX)
+ -rm -f $(web_OBJECTS) $(web_OBJECTS_ap) mod_websh$(SHARED_LIB_SUFFIX) mod_websh$(UNSHARED_LIB_SUFFIX)
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean: clean
Modified: tcl/websh/trunk/src/win/Makefile
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/win/Makefile?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/src/win/Makefile (original)
+++ tcl/websh/trunk/src/win/Makefile Fri May 22 10:13:35 2009
@@ -44,7 +44,7 @@
../generic/sessctx.ws3
# generic objects
-web_OBJECTS_gen = \
+web_OBJECTS = \
args.obj \
cfg.obj \
checksum.obj \
@@ -76,10 +76,7 @@
weboutint.obj \
webutl.obj \
webutlcmd.obj \
- varchannel.obj
-
-# CGI objects (for websh.exe)
-web_OBJECTS_cgi = \
+ varchannel.obj \
modwebsh_cgi.obj \
request_cgi.obj \
response_cgi.obj
@@ -95,9 +92,6 @@
response_ap.obj
-web_OBJECTS = $(web_OBJECTS_gen) $(web_OBJECTS_cgi)
-web_ap_OBJECTS = $(web_OBJECTS_gen) $(web_OBJECTS_ap)
-
# install directories
bindir = $(INSTALL_PREFIX)/bin
moddir = $(INSTALL_PREFIX)/modules
@@ -224,22 +218,24 @@
websh.exe: websh$(VERSION).exe websh$(VERSION).dll
-mod_websh.so: mod_websh$(VERSION).so
+mod_websh.so: mod_websh$(VERSION).so websh$(VERSION).dll
-websh$(VERSION).exe: tclAppInit.$(OBJEXT) $(web_OBJECTS)
+websh$(VERSION).exe: tclAppInit.$(OBJEXT) websh$(VERSION).dll
$(CCLD) $(LD_CFLAGS) $(EXEC_CFLAGS) \
- tclAppInit.$(OBJEXT) $(web_OBJECTS) \
- $(TCL_LIB_SPEC) $(TCL_LIBS) -o websh$(VERSION).exe \
+ tclAppInit.$(OBJEXT) websh$(VERSION).lib \
+ $(TCL_LIB_SPEC) $(TCL_STUB_LIB_SPEC) $(TCL_LIBS) -o websh$(VERSION).exe \
/link /nodefaultlib:$(DEFAULT_MSVCRT)
-mod_websh$(VERSION).so: $(web_ap_OBJECTS)
+mod_websh$(VERSION).so: $(web_OBJECTS_ap) websh$(VERSION).dll
$(CCLD) $(LD_CFLAGS) $(SHLIB_CFLAGS) -o mod_websh$(VERSION).so \
- $(web_ap_OBJECTS) $(TCL_LIB_SPEC) $(HTTPD_LIBS) $(TCL_LIBS) \
+ $(web_OBJECTS_ap) websh$(VERSION).lib $(TCL_LIB_SPEC) \
+ $(TCL_STUB_LIB_SPEC) $(HTTPD_LIBS) $(TCL_LIBS) \
/link /dll /nodefaultlib:msvcrt.lib /subsystem:windows
websh$(VERSION).dll: $(web_OBJECTS)
$(CCLD) $(LD_CFLAGS) $(SHLIB_CFLAGS) -o websh$(VERSION).dll \
- $(web_OBJECTS) $(TCL_LIB_SPEC) $(TCL_LIBS) /link /dll \
+ $(web_OBJECTS) $(TCL_LIB_SPEC) $(TCL_STUB_LIB_SPEC) \
+ $(TCL_LIBS) /link /dll \
/nodefaultlib:$(DEFAULT_MSVCRT) /subsystem:windows
test: websh.exe
Modified: tcl/websh/trunk/src/win/README
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/win/README?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/src/win/README (original)
+++ tcl/websh/trunk/src/win/README Fri May 22 10:13:35 2009
@@ -9,7 +9,7 @@
The following variables in the Makefile must be adapted to your system:
TCL_PREFIX=C:/Program Files/Tcl
- TCL_VERSION=83
+ TCL_VERSION=85
HTTPD_PREFIX=C:/Program Files/Apache Group/Apache2
INSTALL_PREFIX=C:/Program Files/Apache Group/Websh
@@ -33,6 +33,9 @@
nmake test
Run test suite that checks websh<version>.exe and websh<version>.dll
+nmake apachetest
+ Run test suite on mod_websh.so running within Apache Web Server.
+
nmake clean
Clean up all output files
---------------------------------------------------------------------
To unsubscribe, e-mail: websh-cvs-unsubscribe@tcl.apache.org
For additional commands, e-mail: websh-cvs-help@tcl.apache.org