tcl-mod_dtcl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject cvs commit: mod_dtcl/win32 README.mingw32 makefile mod_dtcl.def os.h.diff
Date Thu, 01 Mar 2001 18:32:18 GMT
davidw      01/03/01 10:32:16

  Modified:    .        Makefile README apache_multipart_buffer.c
                        mod_dtcl.c mod_dtcl.h
               contrib  clocks.ttml
               debian   changelog control
               docs     documentation.html examples.ttml
               tests    dtcl-test.ttml
  Added:       contrib  newtags.sh
               win32    README.mingw32 makefile mod_dtcl.def os.h.diff
  Log:
  Big changes: switched <+ +> tags to <? ?>.  Script provided to change
  .ttml files, as well as backwards compatibility code in mod_dtcl.c.
  
  Added Craig's work on the win32/ build stuff.
  
  Revision  Changes    Path
  1.8       +2 -2      mod_dtcl/Makefile
  
  Index: Makefile
  ===================================================================
  RCS file: /home/cvs/mod_dtcl/Makefile,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Makefile	2001/02/20 12:40:39	1.7
  +++ Makefile	2001/03/01 18:31:25	1.8
  @@ -1,4 +1,4 @@
  -# $Id: Makefile,v 1.7 2001/02/20 12:40:39 davidw Exp $
  +# $Id: Makefile,v 1.8 2001/03/01 18:31:25 davidw Exp $
   
   # Changed to use the Tcl variables from tclConfig.sh
   
  @@ -43,7 +43,7 @@
   apache_request.o: apache_request.c apache_request.h
   	$(COMPILE)
   mod_dtcl.o: mod_dtcl.c mod_dtcl.h tcl_commands.h apache_request.h
  -	$(COMPILE)
  +	$(COMPILE) -DDTCL_VERSION=`cat VERSION`
   tcl_commands.o: tcl_commands.c tcl_commands.h mod_dtcl.h
   	$(COMPILE)
   
  
  
  
  1.2       +6 -1      mod_dtcl/README
  
  Index: README
  ===================================================================
  RCS file: /home/cvs/mod_dtcl/README,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- README	2001/02/12 21:21:35	1.1
  +++ README	2001/03/01 18:31:28	1.2
  @@ -1,3 +1,8 @@
   Documentation for mod_dtcl, including use and installation, may be
   found in the docs/ directory.  See documentation.txt or
  -documentation.html for instructions on installing mod_dtcl.
  \ No newline at end of file
  +documentation.html for instructions on installing mod_dtcl.
  +
  +As of version 0.9.4, dtcl now uses <? ?> tags instead of <+ +>.  The
  +newtags.sh shell script in the contrib/ directory will update your
  +.ttml files for you.  For now, mod_dtcl contains compatibility code so
  +that your old scripts will still run.
  
  
  
  1.3       +0 -1      mod_dtcl/apache_multipart_buffer.c
  
  Index: apache_multipart_buffer.c
  ===================================================================
  RCS file: /home/cvs/mod_dtcl/apache_multipart_buffer.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- apache_multipart_buffer.c	2001/02/25 19:51:59	1.2
  +++ apache_multipart_buffer.c	2001/03/01 18:31:29	1.3
  @@ -182,7 +182,6 @@
   /* finds a boundary */
   int find_boundary(multipart_buffer *self, char *boundary)
   {
  -    int len, bound_len = strlen(boundary);
       char *line;
       
       /* loop thru lines */
  
  
  
  1.20      +52 -26    mod_dtcl/mod_dtcl.c
  
  Index: mod_dtcl.c
  ===================================================================
  RCS file: /home/cvs/mod_dtcl/mod_dtcl.c,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- mod_dtcl.c	2000/12/29 13:14:05	1.19
  +++ mod_dtcl.c	2001/03/01 18:31:30	1.20
  @@ -58,7 +58,7 @@
    * University of Illinois, Urbana-Champaign.
    */
   
  -/* $Id: mod_dtcl.c,v 1.19 2000/12/29 13:14:05 davidw Exp $  */
  +/* $Id: mod_dtcl.c,v 1.20 2001/03/01 18:31:30 davidw Exp $  */
   
   /* mod_dtcl.c by David Welton <davidw@apache.org> - originally mod_include.  */
   /* See http://tcl.apache.org/mod_dtcl/credits.ttml for additional credits. */
  @@ -439,7 +439,7 @@
   
   	char c;
   	int ch;
  -	int l = strlen(ENDING_SEQUENCE), l2 = strlen(STARTING_SEQUENCE), p = 0;
  +	int endseqlen = strlen(ENDING_SEQUENCE), startseqlen = strlen(STARTING_SEQUENCE), p =
0;
   
   	FILE *f = NULL;
   
  @@ -464,23 +464,38 @@
   
   	while ((ch = getc(f)) != EOF)
   	{
  -	    /* ok, if we find the string, then we start on another loop    */
  -	    /*            if (!find_string(f, STARTING_SEQUENCE, r))  */
  +	    if (ch == -1)
  +		if (ferror(f))
  +		{
  +		    ap_log_error(APLOG_MARK, APLOG_ERR, r->server,
  +				 "Encountered error in mod_dtcl getchar routine while reading %s",
  +				 r->uri);
  +			ap_pfclose( r->pool, f);
  +		}	    
  +	    c = ch;
   	    if (!inside)
   	    {
   		/* OUTSIDE  */
  -		if (ch == -1)
  -		    if (ferror(f))
  +
  +#if USE_OLD_TAGS == 1
  +		if (c == '<')
  +		{
  +		    int nextchar = getc(f);
  +		    if (nextchar == '+')
   		    {
  -			ap_log_error(APLOG_MARK, APLOG_ERR, r->server,
  -				     "Encountered error in mod_dtcl getchar routine while reading %s",
  -				     r->uri);
  -			ap_pfclose( r->pool, f);
  +			Tcl_AppendToObj(outbuf, "\"\n", 2);
  +			inside = 1;
  +			p = 0;
  +			continue;			
  +		    } else {
  +			ungetc(nextchar, f);
   		    }
  -		c = ch;
  +		}
  +#endif
  +
   		if (c == strstart[p])
   		{
  -		    if (( ++p ) == l)
  +		    if ((++p) == endseqlen)
   		    {
   			/* ok, we have matched the whole ending sequence - do something  */
   			Tcl_AppendToObj(outbuf, "\"\n", 2);
  @@ -489,7 +504,8 @@
   			continue;
   		    }
   		} else {
  -		    Tcl_AppendToObj(outbuf, (char *)strstart, p);
  +		    if (p > 0)
  +			Tcl_AppendToObj(outbuf, (char *)strstart, p);
   		    /* or else just put the char in outbuf  */
   		    if (c == '$')
   			Tcl_AppendToObj(outbuf, "\\$", -1);
  @@ -509,24 +525,29 @@
   		}
   	    } else {
   		/* INSIDE  */
  -		if (ch == -1)
  -		    if (ferror(f))
  +
  +#if USE_OLD_TAGS == 1
  +		if (c == '+')
  +		{
  +		    int nextchar = getc(f);
  +		    if (nextchar == '>')
   		    {
  -			ap_log_error(APLOG_MARK, APLOG_ERR, r->server,
  -				     "Encountered error in mod_dtcl getchar routine while reading %s",
  -				     r->uri);
  -			ap_pfclose( r->pool, f);
  -			return DONE;
  +			Tcl_AppendToObj(outbuf, "\n hputs \"", -1);
  +			inside = 0;
  +			p = 0;
  +			continue;
  +		    } else {
  +			ungetc(nextchar, f);
   		    }
  -
  -		c  = ch;
  +		}
  +#endif
   
   		if (c == strend[p])
   		{
  -		    if ((++p) == l2)
  +		    if ((++p) == startseqlen)
   		    {
  -			inside = 0;
   			Tcl_AppendToObj(outbuf, "\n hputs \"", -1);
  +			inside = 0;
   			p = 0;
   			continue;
   		    }
  @@ -534,7 +555,8 @@
   		else
   		{
   		    /*  plop stuff into outbuf, which we will then eval   */
  -		    Tcl_AppendToObj(outbuf, (char *)strend, p);
  +		    if (p > 0)
  +			Tcl_AppendToObj(outbuf, (char *)strend, p);
   		    Tcl_AppendToObj(outbuf, &c, 1);
   		    p = 0;
   		}
  @@ -867,12 +889,16 @@
       }
   }
   
  -void dtcl_init_handler(server_rec *s, pool *p)
  +MODULE_VAR_EXPORT void dtcl_init_handler(server_rec *s, pool *p)
   {
   #if THREADED_TCL == 0
       tcl_init_stuff(s, p);
   #endif
  +#ifndef HIDE_DTCL_VERSION
  +    ap_add_version_component("mod_dtcl/"DTCL_VERSION);
  +#else
       ap_add_version_component("mod_dtcl");
  +#endif /* !HIDE_DTCL_VERSION */
   }
   
   const char *set_script(cmd_parms *cmd, void *dummy, char *arg, char *arg2)
  
  
  
  1.2       +13 -3     mod_dtcl/mod_dtcl.h
  
  Index: mod_dtcl.h
  ===================================================================
  RCS file: /home/cvs/mod_dtcl/mod_dtcl.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- mod_dtcl.h	2000/12/19 11:59:10	1.1
  +++ mod_dtcl.h	2001/03/01 18:31:32	1.2
  @@ -19,16 +19,26 @@
   #define THREADED_TCL 0 /* Unless you have MINGW32, modify this one! */
   #endif
   
  +/* If you want to show the mod_dtcl version, you can define this to 0.
  +   Otherwise, set this to 1 to hide the version from potential
  +   troublemakers.  */
  +#define HIDE_DTCL_VERSION 1
  +
   /* Turn on the translation stuff.  This will translate things to UTF
      correctly.  Turn off *only* if you will *not* use anything but
      plain ascii */
  -
   #define DTCL_I18N 1
   
  +/* Allow <+ +> tags for backwards compatibility.  Use the
  +   mod_dtcl/contrib/newtags.sh script to update your .ttml files to
  +   use <? ?> tags. */
  +#define USE_OLD_TAGS 1 
  +
   /* End Configuration options  */
  +
  +#define STARTING_SEQUENCE "<?"
  +#define ENDING_SEQUENCE "?>"
   
  -#define STARTING_SEQUENCE "<+"
  -#define ENDING_SEQUENCE "+>"
   #define DEFAULT_ERROR_MSG "[an error occurred while processing this directive]"
   #define DEFAULT_TIME_FORMAT "%A, %d-%b-%Y %H:%M:%S %Z"
   #define DEFAULT_HEADER_TYPE "text/html"
  
  
  
  1.3       +2 -2      mod_dtcl/contrib/clocks.ttml
  
  Index: clocks.ttml
  ===================================================================
  RCS file: /home/cvs/mod_dtcl/contrib/clocks.ttml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- clocks.ttml	2000/10/04 22:37:05	1.2
  +++ clocks.ttml	2001/03/01 18:31:41	1.3
  @@ -1,5 +1,5 @@
   <table>
  -<+
  +<?
   # Creates a table that displays the times in various locations in the
   # world - davidw
   
  @@ -18,5 +18,5 @@
       hputs "</tt></td></tr>"
   }
   unset env(TZ)
  -+>
  +?>
   </table>
  
  
  
  1.1                  mod_dtcl/contrib/newtags.sh
  
  Index: newtags.sh
  ===================================================================
  #!/bin/sh
  
  # $Id: newtags.sh,v 1.1 2001/03/01 18:31:43 davidw Exp $ 
  
  #This script transforms the old <+ +> mod_dtcl tags into the new <? ?>
  #tags.
  
  #Run it in your server root directory.
  
  for fn in `find . -name "*.ttml"` ;     
      do 
      echo -n "Editing $fn "
      sed -e 's/<+/<?/g' -e 's/+>/?>/g' $fn > $fn.new; 
      echo "... done"
      mv $fn.new $fn ; 
  done
  
  
  
  
  1.6       +10 -0     mod_dtcl/debian/changelog
  
  Index: changelog
  ===================================================================
  RCS file: /home/cvs/mod_dtcl/debian/changelog,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- changelog	2001/02/16 13:18:22	1.5
  +++ changelog	2001/03/01 18:31:48	1.6
  @@ -1,3 +1,13 @@
  +libapache-mod-dtcl (0.9.3-2) unstable; urgency=low
  +
  +  * Added build depends.
  +  
  +  * Closes #85787.
  +  
  +  * Closes #87251.
  +
  + -- David N. Welton <davidw@debian.org>  Mon, 26 Feb 2001 14:01:34 +0100
  +
   libapache-mod-dtcl (0.9.3-1) unstable; urgency=low
   
     * New version.
  
  
  
  1.4       +1 -0      mod_dtcl/debian/control
  
  Index: control
  ===================================================================
  RCS file: /home/cvs/mod_dtcl/debian/control,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- control	2001/02/12 19:27:12	1.3
  +++ control	2001/03/01 18:31:49	1.4
  @@ -6,6 +6,7 @@
   
   Package: libapache-mod-dtcl
   Architecture: any
  +Build-Depends: tcl8.3-dev, apache-dev
   Depends: ${shlibs:Depends}, apache-common (>= 1.3.6)
   Description: Server side Tcl scripting for Apache
    The mod_dtcl Apache module enables the use of Tcl as an HTML-embedded
  
  
  
  1.5       +20 -5     mod_dtcl/docs/documentation.html
  
  Index: documentation.html
  ===================================================================
  RCS file: /home/cvs/mod_dtcl/docs/documentation.html,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- documentation.html	2001/02/12 19:27:16	1.4
  +++ documentation.html	2001/03/01 18:31:57	1.5
  @@ -1,4 +1,4 @@
  -<!-- $Id: documentation.html,v 1.4 2001/02/12 19:27:16 davidw Exp $ -->
  +<!-- $Id: documentation.html,v 1.5 2001/03/01 18:31:57 davidw Exp $ -->
         <h2>mod_dtcl Documentation</h2>
         
         <h3>1) Installation</h3>
  @@ -320,8 +320,8 @@
   	  share variables, and most importantly, loaded modules,
   	  from a common parent (such as one of the InitScripts).
   	  When a file is loaded, it is transformed into a Tcl
  -	  script by putting everything outside of &lt;+ and
  -	  +&gt; into large hputs statements.  When the script is
  +	  script by putting everything outside of &lt;? and
  +	  ?&gt; into large hputs statements.  When the script is
   	  complete, it is then inserted into the cache, for
   	  future use.  In fact, if the file modification
   	  information doesn't change, mod_dtcl will execute the
  @@ -333,8 +333,23 @@
   	  images, or loading binary data with 'include'.
   	</li>
         </ul>
  -      
  -      <h3>5) Getting Help</h3>
  +
  +      <h3>5) Upgrading From Older (< 0.9.3) Versions</h3>
  +      <ul>
  +	<li><b>New tags</b><br> As of version 0.9.4, mod_dtcl uses
  +	  &lt;? and ?&gt; instead of &lt;+ and +&gt; to delimit
  +	  sections of Tcl code.  By default, dtcl is still compiled
  +	  with code to parse the &lt;?  ?&gt; tags, but it will run
  +	  faster if <code>USE_OLD_TAGS</code> is set to 0 in
  +	  <code>mod_dtcl.h</code>.  You can automatically change your
  +	  .ttml files to the new format by using the
  +	  <code>newtags.sh</code> script in the contrib/ directory.
  +	  Run it at the top level of your DocumentRoot.
  +
  +	</li>
  +      </ul>
  +
  +      <h3>6) Getting Help</h3>
         <ul>
   	<li><b>Mailing list</b><br>
   	  <p>
  
  
  
  1.4       +24 -24    mod_dtcl/docs/examples.ttml
  
  Index: examples.ttml
  ===================================================================
  RCS file: /home/cvs/mod_dtcl/docs/examples.ttml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- examples.ttml	2000/11/15 18:30:27	1.3
  +++ examples.ttml	2001/03/01 18:31:59	1.4
  @@ -1,6 +1,6 @@
   <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.0//EN">
   <html>
  -<!-- $Id: examples.ttml,v 1.3 2000/11/15 18:30:27 davidw Exp $ -->
  +<!-- $Id: examples.ttml,v 1.4 2001/03/01 18:31:59 davidw Exp $ -->
   <title>mod_dtcl examples</title>
   <body bgcolor=white>
   
  @@ -22,7 +22,7 @@
   <tr><td><hr><b>Hello world</b></td></tr>
   <tr><td bgcolor=gray><pre>
   
  -&lt;+
  +&lt;?
   headers setcookie "foo" "bar" # we have to put this before any 'hputs' statements
   
   # once buffering is switched off, it is no longer possible to
  @@ -30,7 +30,7 @@
   buffered off
   
   hputs "Hello world"
  -+&gt;
  +?&gt;
   
   </pre>
   	  </td></tr>
  @@ -39,7 +39,7 @@
   Produces:
   <p>
   
  -<+
  +<?
   headers setcookie "foo" "bar"
   
   # once buffering is switched off, it is no longer possible to
  @@ -47,7 +47,7 @@
   buffered off
   
   hputs "hello world" 
  -+>
  +?>
   
   <p>
   
  @@ -60,11 +60,11 @@
   
   <tr><td bgcolor=gray><pre>
   
  -&lt;+ if { 1 } { +&gt;
  +&lt;? if { 1 } { ?&gt;
   
   &lt;h2&gt; True &lt;/h2&gt;
   
  -&lt;+ }  +&gt;
  +&lt;? }  ?&gt;
   
   </td></tr></pre>
   
  @@ -72,11 +72,11 @@
   Produces:
   <p>
   
  -<+ if { 1 } { +>
  +<? if { 1 } { ?>
   
   <h2> True </h2>
   
  -<+ } +>
  +<? } ?>
   </td></tr>
   
   <tr><td><hr><b>Loops:</b>
  @@ -84,36 +84,36 @@
   
   <tr><td bgcolor=gray><pre>
   
  -&lt;+ 
  +&lt;? 
   set x 0 
   while { $x &lt; 5 } { 
    hputs "\$x = $x&lt;br>"
    incr x
  -+&gt;
  +?&gt;
   
   LOOP&lt;br>
   
  -&lt;+ }  +&gt;
  +&lt;? }  ?&gt;
   
   </pre>
   </td></tr>
   
   <tr><td>Produces:<p>
  -<+
  +<?
   set x 0
   while { $x < 5 } { 
    hputs "\$x = $x<br>"
    incr x
  -+>
  +?>
   LOOP<BR>
  -<+ } +>
  +<? } ?>
   </td></tr>
   
   <tr><td><hr><b>Variables (environmental as well as those passed
to the script)</b><p>
   </td></tr>
   <tr><td bgcolor=gray><pre>
   
  -&lt;+ 
  +&lt;? 
    hgetvars
   if { [ array exists VARS ] } {
       hputs "&lt; ul>"
  @@ -141,13 +141,13 @@
       hputs "&lt;/ul>"
   }
   
  -+&gt;
  +?&gt;
   
   </pre>
   </td></tr>
   
   <tr><td>Produces:<p>
  -<+
  +<?
   hgetvars
   if { [ array exists VARS ] } {
       hputs "<ul>"
  @@ -174,14 +174,14 @@
       hputs "</ul>"
   }
   
  -+>
  +?>
   </td></tr>
   
   <tr><td><hr><b>Create a table on the fly</b><p>
   </td></tr>
   <tr><td bgcolor=gray><pre>
   
  -&lt;+
  +&lt;?
   set i 1
   hputs "&lt;table&gt;\n"
   
  @@ -196,12 +196,12 @@
   }
   
   hputs "&lt;/table&gt;\n"
  -+&gt;
  +?&gt;
   </pre>
   </td></tr>
   
   <tr><td>Produces:<p>
  -<+
  +<?
   set i 1
   hputs "<table>\n"
   
  @@ -216,7 +216,7 @@
   }
   
   hputs "</table>\n"
  -+>
  +?>
   </td></tr>
   
   <tr><td><hr> <b>In addition</b><br> 
  @@ -231,7 +231,7 @@
   
   </table>
   
  -<+ dtcl_info +>
  +<? dtcl_info ?>
   
   
   <p>
  
  
  
  1.3       +2 -2      mod_dtcl/tests/dtcl-test.ttml
  
  Index: dtcl-test.ttml
  ===================================================================
  RCS file: /home/cvs/mod_dtcl/tests/dtcl-test.ttml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- dtcl-test.ttml	2000/10/18 17:41:48	1.2
  +++ dtcl-test.ttml	2001/03/01 18:32:06	1.3
  @@ -1,4 +1,4 @@
  -<+
  +<?
   
   hgetvars
   
  @@ -31,4 +31,4 @@
       }
   }
   
  -+>
  \ No newline at end of file
  +?>
  \ No newline at end of file
  
  
  
  1.1                  mod_dtcl/win32/README.mingw32
  
  Index: README.mingw32
  ===================================================================
  Steps for building mod_dtcl under NT for Apache with MingW32 
  (http://www.mingw.org/). 
  
  1)  Get Apache for NT, I used version 1.3.X.  You can use the binary release 
  or build it from source.  I built from source because I needed to also include
  mod_ssl.  Note that I used VC++ to build Apache - they don't support MingW32 
  yet AFAIK.
  
  2) Edit the win32\makefile in the mod_dtcl source tree to reflect 
  your environment, i.e. where is Tcl installed, where is Apache installed, where
  are your Apache sources and object files, etc.
  
  3)  Apply the diffs for Apache.  The diff for Apache wraps a few 
  declarations and one #include directive in the os.h file that aren't needed or 
  used with the MingW32 compiler.  I used GNU patch to do this with :
  
  	patch -c -b < os.h.diff
  
  4)  Run make.  There will be some warnings about a redefinition - 
  you can ignore it. You should be left with a file called ApacheModuleDtcl.dll.
  If you are using Apache 1.3.17 or newer that uses .so files for modules, you can
  run 'make so_style' to get a mod_dtcl.so.  Or you can simply rename the dll :)   
  
  5)  Run make install.  Make the changes to your Apache configuration as 
  described on the mod_dtcl documentation, and you are off.
  
  Notes :
  
  	-- Tcl needs to be in the path of the web server
  	-- These instructions assume you have the MingW32 gcc setup as well 
  	   as a good collection of GNU tools on your NT machine (sed, grep, etc).
  	   They also assume you have Tcl setup.  
  	-- You will need a fairly recent version of the MingW32 toolset and the 
  	   associated win32api fileset - see http://www.mingw.org for details on 
  	   obtaining new releases.
  	-- I've tried my best to make these instructions error free but
  	   mistakes are possible.  
  
  Good Luck,
  Craig
  
  
  
  1.1                  mod_dtcl/win32/makefile
  
  Index: makefile
  ===================================================================
  # 
  # makefile for mod_dtcl and MingW32
  # 
  # 
  
  #
  # I use this as a pointer to a good temporary location. 
  # The default works for most people
  #
  TEMP_LIBS = C:\\TEMP
  
  #
  # Set this to your TCL version
  #
  TCL_VERSION = 83
  
  # 
  # Set TCL_HOME to where you have installed Tcl
  #
  TCL_HOME = C:\\Progra~1\\Tcl
  TCL_INC = $(TCL_HOME)\\include
  TCL_LIB = $(TCL_HOME)\\lib
  
  #
  # Set this to where you have installed Apache - used for the install step.
  #
  APACHE_HOME = C:\\"Program Files\\Apache Group\\Apache"
  
  #
  # Set APACHE_SRC to where your APACHE sources live.
  # NOTE: You must apply the diff to the os.h file as described in the
  # readme, and this directory must contain built sources, e.g. object files
  #
  APACHE_SRC = ..\\apache
  
  #
  # Set APACHE_INC to where the APACHE source include files live. This default
  # should be OK.
  #
  APACHE_INC = $(APACHE_SRC)\\src\\include
  
  #
  # Set APACHE_LIB and APACHE_DEF to where you'd like a MingW32 compatible
  # APACHE library file and DLL DEF file put.  You normally only need these
  # during a build, so a temporary location is OK
  #
  APACHE_LIB = $(TEMP_LIBS) 
  APACHE_DEF = $(TEMP_LIBS)\\ApacheCore.def
  
  
  #
  # You shouldn't have to change anything below this
  #
  ROOT_DIR = ..\\
  
  CC = gcc -O3 -fnative-struct -shared -mwindows -DSHARED_MODULE -DDTCL_VERSION="\"`cat $(ROOT_DIR)\\VERSION`\""
  
  INCLUDES = -I$(TCL_INC) -I$(APACHE_INC)
  LIBS = $(TCL_LIB)\\tcl$(TCL_VERSION).lib -L$(APACHE_LIB) -lapachecore 
  
  APREQ_OBJECTS = apache_cookie.o apache_multipart_buffer.o apache_request.o
  OBJECTS = tcl_commands.o $(APREQ_OBJECTS)
  
  DLL_CFLAGS = -DEAPI=1
  
  DLL_EXP_LIB = libmod_dtcl.a
  DLL_EXP_DEF = mod_dtcl.def
  DLL_DYNAMIC = ApacheModuleDtcl.dll 
  DLL_SO	= mod_dtcl.so
  DLL_OBJS = mod_dtcl.o $(OBJECTS) 
  
  DLLWRAP_FLAGS = --def $(DLL_EXP_DEF) \
  	--implib $(DLL_EXP_LIB) \
  	--driver-name $(CC)
  
  #
  # By default we build a .dll file (Apache < 1.3.14)
  #
  all : apache_libs $(DLL_DYNAMIC)
  
  dll_style: apache_libs $(DLL_DYNAMIC)
  
  so_style:	apache_libs $(DLL_SO)
  
  $(DLL_DYNAMIC):	$(DLL_OBJS) makefile
  	$(CC) --dll --kill-at --disable-stdcall-fixup \
  		-o $(DLL_DYNAMIC) $(DLL_OBJS) $(LIBS)
  
  # 
  # This does the same thing as the above, yet names the output file
  # with a .so extension to match the "new" Apache style.
  #
  $(DLL_SO):	$(DLL_OBJS) makefile
  	$(CC) --dll --kill-at --disable-stdcall-fixup \
  		-o $(DLL_SO) $(DLL_OBJS) $(LIBS)
  
  apache_cookie.o: $(ROOT_DIR)apache_cookie.c $(ROOT_DIR)apache_cookie.h
  	$(CC) -c $(DLL_CFLAGS) $(INCLUDES) -D_AP_OS_IS_PATH_ABS_ -o $@ $<
  apache_multipart_buffer.o: $(ROOT_DIR)apache_multipart_buffer.c $(ROOT_DIR)apache_multipart_buffer.h
  	$(CC) -c $(DLL_CFLAGS) $(INCLUDES) -D_AP_OS_IS_PATH_ABS_ -o $@ $<
  apache_request.o: $(ROOT_DIR)apache_request.c $(ROOT_DIR)apache_request.h
  	$(CC) -c $(DLL_CFLAGS) $(INCLUDES) -D_AP_OS_IS_PATH_ABS_ -o $@ $<
  mod_dtcl.o: $(ROOT_DIR)mod_dtcl.c $(ROOT_DIR)mod_dtcl.h $(ROOT_DIR)tcl_commands.h $(ROOT_DIR)apache_request.h
  	$(CC) -c $(DLL_CFLAGS) $(INCLUDES) -o $@ $<
  tcl_commands.o: $(ROOT_DIR)tcl_commands.c $(ROOT_DIR)tcl_commands.h $(ROOT_DIR)mod_dtcl.h
  	$(CC) -c $(DLL_CFLAGS) $(INCLUDES) -D_AP_OS_IS_PATH_ABS_ -o $@ $<
  
  clean:
  	-@rm -f $(DLL_OBJS) $(DLL_DYNAMIC) $(DLL_SO) $(DLL_EXP_LIB)
  
  install: $(DLL_DYNAMIC) $(DLL_EXP_LIB)
  	echo Installing mod_dtcl...
  	-cp $(DLL_DYNAMIC) $(APACHE_HOME)\\modules
  
  apache_libs:
  	-@mkdir $(TEMP_LIBS)
  	-@rm $(APACHE_DEF)
  	echo EXPORTS > $(APACHE_DEF)
  	nm $(APACHE_SRC)\\src\\CoreR\\ApacheCore.exp |grep " U _" | sed "s/.* U _//" >> $(APACHE_DEF)
  	sed -e "s/ap_log_error$$/ap_log_error@0/g" \
  		-e "s/ap_log_rerror$$/ap_log_rerror@0/g" \
  		-e "s/ap_table_do$$/ap_table_do@0/g" \
  		$(APACHE_DEF) > $(APACHE_DEF).new
  	mv $(APACHE_DEF).new $(APACHE_DEF)
  	dlltool --def $(APACHE_DEF) --dllname ApacheCore.dll \
  		--output-lib $(TEMP_LIBS)\libapachecore.a -k
  	
  
  
  
  1.1                  mod_dtcl/win32/mod_dtcl.def
  
  Index: mod_dtcl.def
  ===================================================================
  EXPORTS
      dtcl_init_handler
      dtcl_module
  
  
  
  1.1                  mod_dtcl/win32/os.h.diff
  
  Index: os.h.diff
  ===================================================================
  *** Vendors/Apache/Apache/src/os/win32/os.h	2001/02/02 08:36:15	1.1
  --- Vendors/Apache/Apache/src/os/win32/os.h	2001/02/28 10:08:50	1.4
  ***************
  *** 109,119 ****
  --- 109,121 ----
    #define HAVE_UNC_PATHS
    typedef int uid_t;
    typedef int gid_t;
  + #ifndef __MINGW32__
    typedef int pid_t;
    #ifdef _MSC_VER
    /* modified to match declaration in sys/stat.h */
    typedef unsigned short mode_t;
    #endif
  + #endif /* !__MINGW32__ */
    typedef char * caddr_t;
    
    /*
  ***************
  *** 163,168 ****
  --- 165,171 ----
    #define NO_OTHER_CHILD
    #define NO_RELIABLE_PIPED_LOGS
    
  + #ifndef _AP_OS_IS_PATH_ABS_
    __inline int ap_os_is_path_absolute(const char *file)
    {
      /* For now, just do the same check that http_request.c and mod_alias.c
  ***************
  *** 170,175 ****
  --- 173,179 ----
       */
      return file && (file[0] == '/' || (file[1] == ':' && file[2] == '/'));
    }
  + #endif
    
    #define stat(f,ps)  os_stat(f,ps)
    API_EXPORT(int) os_stat(const char *szPath,struct stat *pStat);
  
  
  
  

Mime
View raw message