httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gst...@locus.apache.org
Subject cvs commit: apache-2.0/src/lib/aputil apu_private.h.in .cvsignore apu_dbm.c
Date Tue, 28 Nov 2000 12:10:00 GMT
gstein      00/11/28 04:09:58

  Modified:    src      configure.in acinclude.m4
               src/lib/aputil .cvsignore apu_dbm.c
  Added:       src/lib/aputil apu_private.h.in
  Log:
  add --with-dbm switch to configure, allowing the user to set the type of DBM
    that apu_dbm will use (defaults to builtin sdbm). first pass at gdbm
    config support (seems to work fine in my simple test).
  
  - added src/lib/aputil/apu_private.h.in to hold aputil config info
  - apu_dbm.c now uses #if for the config values (rather than #ifdef)
  - cleared out temp hack in configure.in to force sdbm usage
  
  Revision  Changes    Path
  1.91      +6 -3      apache-2.0/src/configure.in
  
  Index: configure.in
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/configure.in,v
  retrieving revision 1.90
  retrieving revision 1.91
  diff -u -u -r1.90 -r1.91
  --- configure.in	2000/11/27 16:32:45	1.90
  +++ configure.in	2000/11/28 12:09:50	1.91
  @@ -36,6 +36,12 @@
   dnl ## Preload our OS configuration
   APR_PRELOAD
   
  +dnl
  +dnl Process command line arguments. This is done early in the process so the
  +dnl user can get feedback quickly in case of an error.
  +dnl
  +APACHE_CHECK_DBM
  +
   dnl ## Check for programs
   
   AC_PROG_AWK
  @@ -174,9 +180,6 @@
   if test "$apache_need_sdbm" = "yes"; then
     AP_LIB_DIRS="$AP_LIB_DIRS sdbm"
     AP_LIBS="$AP_LIBS lib/sdbm/libsdbm.la"
  -  INCLUDES="$INCLUDES -I\$(top_srcdir)/lib/sdbm"
  -else
  -  echo "Adding sdbm to the include list anyway until aputil configuration works..."
     INCLUDES="$INCLUDES -I\$(top_srcdir)/lib/sdbm"
   fi
   if test "$apache_need_expat" = "yes"; then
  
  
  
  1.51      +41 -0     apache-2.0/src/acinclude.m4
  
  Index: acinclude.m4
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/acinclude.m4,v
  retrieving revision 1.50
  retrieving revision 1.51
  diff -u -u -r1.50 -r1.51
  --- acinclude.m4	2000/11/11 06:05:57	1.50
  +++ acinclude.m4	2000/11/28 12:09:50	1.51
  @@ -394,3 +394,44 @@
       apache_cxx_done=yes
     fi
   ])
  +
  +dnl
  +dnl APACHE_CHECK_DBM
  +dnl
  +AC_DEFUN(APACHE_CHECK_DBM,[
  +
  +apu_use_sdbm=0
  +apu_use_gdbm=0
  +AC_MSG_CHECKING(for chosen DBM type)
  +AC_ARG_WITH(dbm,
  +  [  --with-dbm=DBM          Choose the DBM type to use. DBM={sdbm,gdbm}],[
  +  if test "$withval" = "yes"; then
  +    AC_MSG_ERROR([You need to specify a DBM type to use. One of: sdbm, gdbm])
  +  fi
  +  case "$withval" in
  +    sdbm)
  +      apache_need_sdbm=yes
  +      apu_use_sdbm=1
  +      AC_MSG_RESULT(sdbm)
  +      ;;
  +    gdbm)
  +      apu_use_gdbm=1
  +      AC_MSG_RESULT(gdbm)
  +
  +      dnl ### probably need more work in here to locate GDBM
  +      AC_ADD_LIBRARY(gdbm)
  +      ;;
  +    *)
  +      AC_MSG_ERROR([$withval is an unknown DBM type. Use one of: sdbm, gdbm])
  +      ;;
  +  esac
  +],[
  +  apache_need_sdbm=yes
  +  apu_use_sdbm=1
  +  AC_MSG_RESULT([sdbm (default)])
  +])
  +APACHE_SUBST(apu_use_sdbm)
  +APACHE_SUBST(apu_use_gdbm)
  +APACHE_OUTPUT(lib/aputil/apu_private.h)
  +
  +])
  
  
  
  1.2       +1 -0      apache-2.0/src/lib/aputil/.cvsignore
  
  Index: .cvsignore
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/aputil/.cvsignore,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- .cvsignore	2000/11/26 13:43:32	1.1
  +++ .cvsignore	2000/11/28 12:09:53	1.2
  @@ -10,3 +10,4 @@
   Debug
   Release
   aputil.mak
  +apu_private.h
  
  
  
  1.4       +10 -12    apache-2.0/src/lib/aputil/apu_dbm.c
  
  Index: apu_dbm.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/aputil/apu_dbm.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -u -r1.3 -r1.4
  --- apu_dbm.c	2000/11/28 06:33:07	1.3
  +++ apu_dbm.c	2000/11/28 12:09:53	1.4
  @@ -56,12 +56,10 @@
   #include "apr_errno.h"
   #include "apr_pools.h"
   
  +#include "apu_private.h"
   #include "apu_dbm.h"
   
  -/* ### until we get the autoconf magic going... */
  -#define APU_USE_SDBM
  -
  -#ifdef APU_USE_SDBM
  +#if APU_USE_SDBM
   #include "sdbm.h"
   
   typedef SDBM *real_file_t;
  @@ -79,7 +77,7 @@
   #define APU_DBM_DBMODE_RW       (APR_READ | APR_WRITE)
   #define APU_DBM_DBMODE_RWCREATE (APR_READ | APR_WRITE | APR_CREATE)
   
  -#elif defined(APU_USE_GDBM)
  +#elif APU_USE_GDBM
   #include <gdbm.h>
   #include <stdlib.h>     /* for free() */
   
  @@ -132,7 +130,7 @@
   {
       apr_status_t rv = APR_SUCCESS;
   
  -#if defined(APU_USE_SDBM)
  +#if APU_USE_SDBM
   
       if ((db->errcode = sdbm_error(db->file)) == 0) {
           db->errmsg = NULL;
  @@ -145,7 +143,7 @@
       /* captured it. clear it now. */
       sdbm_clearerr(db->file);
   
  -#elif defined(APU_USE_GDBM)
  +#elif APU_USE_GDBM
   
       if ((db->errcode = gdbm_errno) == GDBM_NO_ERROR) {
           db->errmsg = NULL;
  @@ -185,7 +183,7 @@
           return APR_EINVAL;
       }
   
  -#ifdef APU_USE_SDBM
  +#if APU_USE_SDBM
       {
           apr_status_t rv;
   
  @@ -193,7 +191,7 @@
           if (rv != APR_SUCCESS)
               return rv;
       }
  -#else
  +#elif APU_USE_GDBM
       {
           /* Note: stupid cast to get rid of "const" on the pathname */
           file = gdbm_open((char *) pathname, 0, dbmode, 0660, NULL);
  @@ -258,14 +256,14 @@
   {
       int exists;
   
  -#ifdef APU_USE_GDBM
  -    exists = gdbm_exists(db->file, A2R_DATUM(key)) != 0;
  -#else
  +#if APU_USE_SDBM
       {
   	sdbm_datum value = sdbm_fetch(db->file, A2R_DATUM(key));
   	sdbm_clearerr(db->file);	/* don't need the error */
   	exists = value.dptr != NULL;
       }
  +#elif APU_USE_GDBM
  +    exists = gdbm_exists(db->file, A2R_DATUM(key)) != 0;
   #endif
       return exists;
   }
  
  
  
  1.1                  apache-2.0/src/lib/aputil/apu_private.h.in
  
  Index: apu_private.h.in
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2000 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" must
   *    not be used to endorse or promote products derived from this
   *    software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    nor may "Apache" appear in their name, without prior written
   *    permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  #ifndef APU_PRIVATE_H
  #define APU_PRIVATE_H
  
  /*
  ** The following macros control what features APUTIL will use
  */
  #define APU_USE_SDBM	@apu_use_sdbm@
  #define APU_USE_GDBM	@apu_use_gdbm@
  
  #endif	/* !APU_PRIVATE_H */
  
  
  

Mime
View raw message