pier        02/05/03 06:30:26

  Modified:    webapp   configure.in
               webapp/apache-1.3 mod_webapp.c
               webapp/apache-2.0 mod_webapp.c
               webapp/include wa.h wa_version.h
  Added:       webapp/support wa_version.m4
  Log:
  Versioning done right.
  
  Revision  Changes    Path
  1.57      +5 -1      jakarta-tomcat-connectors/webapp/configure.in
  
  Index: configure.in
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/configure.in,v
  retrieving revision 1.56
  retrieving revision 1.57
  diff -u -r1.56 -r1.57
  --- configure.in      3 May 2002 11:40:24 -0000       1.56
  +++ configure.in      3 May 2002 13:30:25 -0000       1.57
  @@ -57,7 +57,7 @@
   
   dnl --------------------------------------------------------------------------
   dnl Author Pier Fumagalli <mailto:[EMAIL PROTECTED]>
  -dnl Version $Id: configure.in,v 1.56 2002/05/03 11:40:24 pier Exp $
  +dnl Version $Id: configure.in,v 1.57 2002/05/03 13:30:25 pier Exp $
   dnl 
   dnl NOTE: close all functions with ]) on the same line otherwise M4 will spit
   dnl       out the last argument of the function with an extra newline.
  @@ -65,6 +65,7 @@
   
   sinclude(./support/wa_util.m4)
   sinclude(./support/wa_exec.m4)
  +sinclude(./support/wa_version.m4)
   sinclude(./support/wa_apr.m4)
   sinclude(./support/wa_apxs.m4)
   
  @@ -236,6 +237,9 @@
   
       MODULE="apache-2.0"
   fi
  +
  +WA_APXS_SERVER([APACHE_VERSION],[${APXS}])
  +WA_VERSION([WEBAPP_VERSION],[${CC}])
   
   dnl --------------------------------------------------------------------------
   dnl All done
  
  
  
  1.33      +11 -12    jakarta-tomcat-connectors/webapp/apache-1.3/mod_webapp.c
  
  Index: mod_webapp.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/apache-1.3/mod_webapp.c,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- mod_webapp.c      3 May 2002 08:42:40 -0000       1.32
  +++ mod_webapp.c      3 May 2002 13:30:25 -0000       1.33
  @@ -57,7 +57,7 @@
   
   /**
    * @author  Pier Fumagalli <mailto:[EMAIL PROTECTED]>
  - * @version $Id: mod_webapp.c,v 1.32 2002/05/03 08:42:40 hgomez Exp $
  + * @version $Id: mod_webapp.c,v 1.33 2002/05/03 13:30:25 pier Exp $
    */
   
   #include <httpd.h>
  @@ -68,7 +68,6 @@
   #include <http_protocol.h>
   #include <util_script.h>
   #include <wa.h>
  -#include <wa_version.h>
   
   /* ************************************************************************* */
   /* GENERIC DECLARATIONS                                                      */
  @@ -83,29 +82,29 @@
   /* The main server using for logging error not related to requests */
   static server_rec *server=NULL;
   
  -static void wam_init_handler(server_rec *s, ap_pool *p)
  -{
  -    ap_add_version_component(WA_EXPOSED_VERSION);
  -}
  -
   /* ************************************************************************* */
   /* MODULE AND LIBRARY INITIALIZATION AND DESTRUCTION                         */
   /* ************************************************************************* */
   
   /* Destroy the module and the WebApp Library */
  -static void wam_shutdown(server_rec *s, pool *p) {/*void *nil) { */
  +static void wam_child_destroy(server_rec *s, pool *p) {
       if (!wam_initialized) return;
       wa_shutdown();
       wam_initialized=wa_false;
   }
   
   /* Startup the module and the WebApp Library */
  -static void wam_startup(server_rec *s, pool *p) {
  +static void wam_child_init(server_rec *s, pool *p) {
       if (!wam_initialized) return;
       server=s;
       wa_startup();
   }
   
  +/* Initialize the module, by adding our version info in Apache. */
  +static void wam_module_init(server_rec *s, ap_pool *p) {
  +    ap_add_version_component(WA_VERSION);
  +}
  +
   /* Initialize the module and the WebApp Library */
   static const char *wam_init(pool *p) {
       const char *ret=NULL;
  @@ -538,7 +537,7 @@
   /* Apache module declaration */
   module MODULE_VAR_EXPORT webapp_module = {
       STANDARD_MODULE_STUFF,
  -    wam_init_handler,                   /* module initializer */
  +    wam_module_init,                    /* module initializer */
       NULL,                               /* per-directory config creator */
       NULL,                               /* dir config merger */
       NULL,                               /* server config creator */
  @@ -553,7 +552,7 @@
       NULL,                               /* [8] fixups */
       NULL,                               /* [10] logger */
       NULL,                               /* [3] header parser */
  -    wam_startup,                        /* child initializer */
  -    wam_shutdown,                       /* child exit/cleanup */
  +    wam_child_init,                     /* child initializer */
  +    wam_child_destroy,                  /* child exit/cleanup */
       NULL                                /* [1] post read_request handling */
   };
  
  
  
  1.9       +12 -14    jakarta-tomcat-connectors/webapp/apache-2.0/mod_webapp.c
  
  Index: mod_webapp.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/apache-2.0/mod_webapp.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- mod_webapp.c      3 May 2002 08:42:40 -0000       1.8
  +++ mod_webapp.c      3 May 2002 13:30:25 -0000       1.9
  @@ -57,7 +57,7 @@
   
   /**
    * @author  Pier Fumagalli <mailto:[EMAIL PROTECTED]>
  - * @version $Id: mod_webapp.c,v 1.8 2002/05/03 08:42:40 hgomez Exp $
  + * @version $Id: mod_webapp.c,v 1.9 2002/05/03 13:30:25 pier Exp $
    */
   
   #include <httpd.h>
  @@ -69,7 +69,6 @@
   #include <http_protocol.h>
   #include <util_script.h>
   #include <wa.h>
  -#include <wa_version.h>
   #include <apr_tables.h>
   
   /* ************************************************************************* */
  @@ -89,15 +88,14 @@
   /* MODULE AND LIBRARY INITIALIZATION AND DESTRUCTION                         */
   /* ************************************************************************* */
   
  -static int wam_init_handler(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp,
  -                             server_rec *s)
  -{
  -    ap_add_version_component(p, WA_EXPOSED_VERSION);
  +static int wam_module_init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp,
  +                            server_rec *s) {
  +    ap_add_version_component(p, WA_VERSION);
       return OK;
   }
   
   /* Destroy the module and the WebApp Library */
  -static apr_status_t wam_shutdown(void *data) {/*void *nil) { */
  +static apr_status_t wam_child_destroy(void *data) {/*void *nil) { */
       if (!wam_initialized) return APR_SUCCESS;
       wa_shutdown();
       wam_initialized=wa_false;
  @@ -105,11 +103,11 @@
   }
   
   /* Startup the module and the WebApp Library */
  -static void wam_startup(apr_pool_t *p, server_rec *s) {
  +static void wam_child_init(apr_pool_t *p, server_rec *s) {
       if (!wam_initialized) return;
       server=s;
       wa_startup();
  -    apr_pool_cleanup_register(p, NULL, wam_shutdown, apr_pool_cleanup_null);
  +    apr_pool_cleanup_register(p, NULL, wam_child_destroy, apr_pool_cleanup_null);
   }
   
   /* Initialize the module and the WebApp Library */
  @@ -528,13 +526,13 @@
       return DECLINED;
   }
   
  -static void register_hooks(apr_pool_t *p)
  +static void wam_hooks(apr_pool_t *p)
   {
  +    ap_hook_post_config(wam_module_init, NULL, NULL, APR_HOOK_MIDDLE);
  +    ap_hook_child_init(wam_child_init, NULL, NULL, APR_HOOK_MIDDLE);
  +    ap_hook_map_to_storage(wam_map_to_storage, NULL, NULL, APR_HOOK_MIDDLE);
       ap_hook_handler(wam_invoke, NULL, NULL, APR_HOOK_MIDDLE);
       ap_hook_translate_name(wam_match, NULL, NULL, APR_HOOK_MIDDLE);
  -    ap_hook_child_init(wam_startup, NULL, NULL, APR_HOOK_MIDDLE);
  -    ap_hook_map_to_storage(wam_map_to_storage, NULL, NULL, APR_HOOK_MIDDLE);
  -    ap_hook_post_config(wam_init_handler, NULL, NULL, APR_HOOK_MIDDLE);
   }
   
   /* Apache module declaration */
  @@ -545,5 +543,5 @@
       NULL,                               /* server config creator */
       NULL,                               /* server config merger */
       wam_directives,                     /* command table */
  -    register_hooks
  +    wam_hooks,
   };
  
  
  
  1.16      +2 -1      jakarta-tomcat-connectors/webapp/include/wa.h
  
  Index: wa.h
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/include/wa.h,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- wa.h      29 Apr 2002 11:02:55 -0000      1.15
  +++ wa.h      3 May 2002 13:30:25 -0000       1.16
  @@ -57,7 +57,7 @@
   
   /**
    * @author  Pier Fumagalli <mailto:[EMAIL PROTECTED]>
  - * @version $Id: wa.h,v 1.15 2002/04/29 11:02:55 jfclere Exp $
  + * @version $Id: wa.h,v 1.16 2002/05/03 13:30:25 pier Exp $
    */
   #ifndef _WA_H_
   #define _WA_H_
  @@ -115,6 +115,7 @@
   #include <wa_main.h>
   #include <wa_config.h>
   #include <wa_request.h>
  +#include <wa_version.h>
   
   /* Debugging mark */
   #define WA_MARK __FILE__,__LINE__
  
  
  
  1.3       +5 -29     jakarta-tomcat-connectors/webapp/include/wa_version.h
  
  Index: wa_version.h
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/include/wa_version.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- wa_version.h      3 May 2002 10:25:04 -0000       1.2
  +++ wa_version.h      3 May 2002 13:30:26 -0000       1.3
  @@ -58,34 +58,10 @@
   #ifndef _WA_VERSION_H_
   #define _WA_VERSION_H_
   
  -
  -/************** START OF AREA TO MODIFY BEFORE RELEASING *************/
  -#define WA_VERMAJOR     1
  -#define WA_VERMINOR     2
  -#define WA_VERFIX       0
  -#define WA_VERSTRING    "1.2.0-dev"
  -
  -/* Beta number */
  -#define WA_VERBETA      1
  -#define WA_BETASTRING   "1"
  -/* set WA_VERISRELEASE to 1 when release (do not forget to commit!) */
  -#define WA_VERISRELEASE 1
  -/************** END OF AREA TO MODIFY BEFORE RELEASING *************/
  -
  -#define PACKAGE "mod_webapp/"
  -/* Build WA_EXPOSED_VERSION and WA_VERSION */
  -#define WA_EXPOSED_VERSION_INT PACKAGE WA_VERSTRING
  -
  -#if ( WA_VERISRELEASE == 1 )
  -#define WA_EXPOSED_VERSION WA_EXPOSED_VERSION_INT
  -#undef WA_VERBETA
  -#define WA_VERBETA 255
  -#else
  -#define WA_EXPOSED_VERSION WA_EXPOSED_VERSION_INT "-beta-" WA_BETASTRING
  -#endif
  -
  -#define WA_MAKEVERSION(major, minor, fix, beta) (((major) << 24) + ((minor) << 16) 
+ ((fix) << 8) + (beta))
  -
  -#define WA_VERSION WA_MAKEVERSION(WA_VERMAJOR, WA_VERMINOR, WA_VERFIX, WA_VERBETA)
  +#define WA_VENDOR   "Apache Software Foundation"
  +#define WA_PRODUCT  "WebApp Module"
  +#define WA_NAME     "mod_webapp"
  +#define WA_REVISION "1.2.0-dev"
  +#define WA_VERSION  WA_NAME "/" WA_REVISION
   
   #endif /* _WA_VERSION_H_ */
  
  
  
  1.1                  jakarta-tomcat-connectors/webapp/support/wa_version.m4
  
  Index: wa_version.m4
  ===================================================================
  dnl  =========================================================================
  dnl
  dnl                  The Apache Software License,  Version 1.1
  dnl
  dnl           Copyright (c) 1999-2001 The Apache Software Foundation.
  dnl                            All rights reserved.
  dnl
  dnl  =========================================================================
  dnl
  dnl  Redistribution and use in source and binary forms,  with or without modi-
  dnl  fication, are permitted provided that the following conditions are met:
  dnl
  dnl  1. Redistributions of source code  must retain the above copyright notice
  dnl     notice, this list of conditions and the following disclaimer.
  dnl
  dnl  2. Redistributions  in binary  form  must  reproduce the  above copyright
  dnl     notice,  this list of conditions  and the following  disclaimer in the
  dnl     documentation and/or other materials provided with the distribution.
  dnl
  dnl  3. The end-user documentation  included with the redistribution,  if any,
  dnl     must include the following acknowlegement:
  dnl
  dnl        "This product includes  software developed  by the Apache  Software
  dnl         Foundation <http://www.apache.org/>."
  dnl
  dnl     Alternately, this acknowlegement may appear in the software itself, if
  dnl     and wherever such third-party acknowlegements normally appear.
  dnl
  dnl  4. The names "The Jakarta Project",  "Apache WebApp Module",  and "Apache
  dnl     Software Foundation"  must not be used to endorse or promote  products
  dnl     derived  from this  software  without  prior  written  permission. For
  dnl     written permission, please contact <[EMAIL PROTECTED]>.
  dnl
  dnl  5. Products derived from this software may not be called "Apache" nor may
  dnl     "Apache" appear in their names without prior written permission of the
  dnl     Apache Software Foundation.
  dnl
  dnl  THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES
  dnl  INCLUDING, BUT NOT LIMITED TO,  THE IMPLIED WARRANTIES OF MERCHANTABILITY
  dnl  AND FITNESS FOR  A PARTICULAR PURPOSE  ARE DISCLAIMED.  IN NO EVENT SHALL
  dnl  THE APACHE  SOFTWARE  FOUNDATION OR  ITS CONTRIBUTORS  BE LIABLE  FOR ANY
  dnl  DIRECT,  INDIRECT,   INCIDENTAL,  SPECIAL,  EXEMPLARY,  OR  CONSEQUENTIAL
  dnl  DAMAGES (INCLUDING,  BUT NOT LIMITED TO,  PROCUREMENT OF SUBSTITUTE GOODS
  dnl  OR SERVICES;  LOSS OF USE,  DATA,  OR PROFITS;  OR BUSINESS INTERRUPTION)
  dnl  HOWEVER CAUSED AND  ON ANY  THEORY  OF  LIABILITY,  WHETHER IN  CONTRACT,
  dnl  STRICT LIABILITY, OR TORT  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  dnl  ANY  WAY  OUT OF  THE  USE OF  THIS  SOFTWARE,  EVEN  IF  ADVISED  OF THE
  dnl  POSSIBILITY OF SUCH DAMAGE.
  dnl
  dnl  =========================================================================
  dnl
  dnl  This software  consists of voluntary  contributions made  by many indivi-
  dnl  duals on behalf of the  Apache Software Foundation.  For more information
  dnl  on the Apache Software Foundation, please see <http://www.apache.org/>.
  dnl
  dnl  =========================================================================
  
  dnl --------------------------------------------------------------------------
  dnl Author Pier Fumagalli <[EMAIL PROTECTED]>
  dnl Version $Id: wa_version.m4,v 1.1 2002/05/03 13:30:26 pier Exp $
  dnl --------------------------------------------------------------------------
  
  dnl --------------------------------------------------------------------------
  dnl WA_VERSION
  dnl   xxxx
  dnl   $1 => xxxx.
  dnl --------------------------------------------------------------------------
  AC_DEFUN(
    [WA_VERSION],
    [
      cat > ${TGT_DIR}/wa_version.c << EOF
  #include "${SRC_DIR}/include/wa_version.h"
  #include "stdio.h"
  
  int main(void) [ {
    printf(WA_VERSION "\n");
    exit(0);
  } ]
  EOF
      AC_MSG_CHECKING([for version])
      $2 ${TGT_DIR}/wa_version.c -o ${TGT_DIR}/wa_version.o
      if test "$?" != "0" ; then
        AC_MSG_ERROR([compiler didn't run successfully])
      fi
      $1=`${TGT_DIR}/wa_version.o`
      if test "$?" != "0" ; then
        AC_MSG_ERROR([cannot execute wa_version.o])
      fi
      if test -z "${$1}" ; then
        AC_MSG_ERROR([empty version number])
      fi
      rm -f "${TGT_DIR}/wa_version.o"
      rm -f "${TGT_DIR}/wa_version.c"
      AC_MSG_RESULT([${$1}])
      
    ])
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to