You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rb...@locus.apache.org on 2000/06/10 18:08:38 UTC

cvs commit: apache-2.0/src/lib/apr/include apr.h.in

rbb         00/06/10 09:08:37

  Modified:    src/lib/apr acconfig.h aclocal.m4 configure.in
               src/lib/apr/include apr.h.in
  Log:
  Change the APR configure process to call MM's configure script early
  instead of at the end of the script.  With this change, APR can determine
  if shared memory is provided using a file that multiple platforms can open,
  or if it is acheived using some sort of shared memory (including MMAP'ed
  files).  This information is used in Apache to provide some optimizations.
  
  Revision  Changes    Path
  1.29      +2 -0      apache-2.0/src/lib/apr/acconfig.h
  
  Index: acconfig.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/acconfig.h,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- acconfig.h	2000/05/16 21:37:05	1.28
  +++ acconfig.h	2000/06/10 16:08:36	1.29
  @@ -53,6 +53,8 @@
   #undef SIZEOF_SSIZE_T
   #undef SIZEOF_OFF_T
   
  +#undef HAVE_MM_SHMT_MMFILE
  +
   @BOTTOM@
   
   /* Make sure we have ssize_t defined to be something */
  
  
  
  1.15      +33 -0     apache-2.0/src/lib/apr/aclocal.m4
  
  Index: aclocal.m4
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/aclocal.m4,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- aclocal.m4	2000/05/22 18:13:17	1.14
  +++ aclocal.m4	2000/06/10 16:08:36	1.15
  @@ -261,5 +261,38 @@
     fi
   ])
   
  +AC_DEFUN(RUN_SUBDIR_CONFIG_NOW, [
  +  echo "configuring package in $1 now"
  +  ac_popdir=`pwd`
  +  cd $1
  +
  +  # Make the cache file name correct relative to the subdirectory.
  +  case "$cache_file" in
  +  /*) ac_sub_cache_file=$cache_file ;;
  +  *) # Relative path.
  +    ac_sub_cache_file="$ac_dots$cache_file" ;;
  +  esac
  +
  +  case "$srcdir" in
  +  .) # No --srcdir option.  We are building in place.
  +    ac_sub_srcdir=$srcdir ;;
  +  /*) # Absolute path.
  +    ac_sub_srcdir=$srcdir/$ac_config_dir ;;
  +  *) # Relative path.
  +    ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;;
  +  esac
  +
  +  # The eval makes quoting arguments work.
  + 
  +  if eval ./configure --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir
  +  then :
  +    echo "$1 configured properly"
  +  else
  +    echo "configure failed for $1"
  +  fi
  +
  +  cd $ac_popdir
  +])
  +
   sinclude(threads.m4)
   sinclude(hints.m4)
  
  
  
  1.106     +54 -40    apache-2.0/src/lib/apr/configure.in
  
  Index: configure.in
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/configure.in,v
  retrieving revision 1.105
  retrieving revision 1.106
  diff -u -r1.105 -r1.106
  --- configure.in	2000/06/10 14:49:52	1.105
  +++ configure.in	2000/06/10 16:08:37	1.106
  @@ -102,6 +102,60 @@
          ;;
   esac
   
  +dnl #----------------------------- Checking for Shared Memory Support 
  +echo $ac_n "${nl}Checking for Shared Memory Support...${nl}"
  +
  +# run the MM config script regardless of whether we are going to use
  +# it or not.  When we have a much better idea of who is using MM, we can
  +# run this on a more conditional basis.
  +USE_MM=yes
  +mm_dir=shmem/unix/mm
  +RUN_SUBDIR_CONFIG_NOW($config_subdirs)
  +
  +AC_MSG_CHECKING(Checking for Shared memory support)
  +AC_ARG_ENABLE(shmem,
  +  [  --enable-shmem          Enable shared memory support in APR. ],
  +  [ ],
  +  ac_cv_enable_shmem="mm" )
  +
  +sharedmem="0"
  +anonymous_shm="0"
  +filebased_shm="0"
  +keybased_shm="0"
  +if test "$ac_cv_enable_shmem" = "mm"; then
  +  sharedmem="1"
  +  anonymous_shm="1"
  +  AC_MSG_RESULT(anonymous)
  +elif test "$ac_cv_enable_shmem" = "file"; then
  +  sharedmem="1"
  +  filebased_shm="1"
  +  AC_MSG_RESULT(file based)
  +elif test "$ac_cv_enable_shmem" = "key"; then
  +  sharedmem="1"
  +  keybased_shm="1"
  +  AC_MSG_RESULT(key based)
  +else
  +  AC_MSG_RESULT(no)
  +fi
  +AC_SUBST(sharedmem)
  +AC_SUBST(anonymous_shm)
  +AC_SUBST(filebased_shm)
  +AC_SUBST(keybased_shm)
  +
  +echo "$srcdir"
  +AC_CHECK_DEFINE(MM_SHMT_MMFILE, $srcdir/shmem/unix/mm/mm_conf.h) 
  +
  +if test "ac_cv_define_MM_SHMT_MMFILE" = "yes"; then
  +    file_based="1"
  +    mem_based="0"
  +else
  +    file_based="0"
  +    mem_based="1"
  +fi
  +
  +AC_SUBST(mem_based)
  +AC_SUBST(file_based)
  +
   if test ".$SYS_SW" = ".AIX"; then
       CFLAGS="$CFLAGS -U__STR__"
       case "$SYS_KV" in
  @@ -516,46 +570,6 @@
   AC_SUBST(fcntlser)
   AC_SUBST(procpthreadser)
   AC_SUBST(pthreadser)
  -
  -dnl #----------------------------- Checking for Shared Memory Support 
  -echo $ac_n "${nl}Checking for Shared Memory Support...${nl}"
  -
  -# run the MM config script regardless of whether we are going to use
  -# it or not.  When we have a much better idea of who is using MM, we can
  -# run this on a more conditional basis.
  -USE_MM=yes
  -mm_dir=shmem/unix/mm
  -AC_CONFIG_SUBDIRS($config_subdirs)
  -
  -AC_MSG_CHECKING(Checking for Shared memory support)
  -AC_ARG_ENABLE(shmem,
  -  [  --enable-shmem          Enable shared memory support in APR. ],
  -  [ ],
  -  ac_cv_enable_shmem="mm" )
  -
  -sharedmem="0"
  -anonymous_shm="0"
  -filebased_shm="0"
  -keybased_shm="0"
  -if test "$ac_cv_enable_shmem" = "mm"; then
  -  sharedmem="1"
  -  anonymous_shm="1"
  -  AC_MSG_RESULT(anonymous)
  -elif test "$ac_cv_enable_shmem" = "file"; then
  -  sharedmem="1"
  -  filebased_shm="1"
  -  AC_MSG_RESULT(file based)
  -elif test "$ac_cv_enable_shmem" = "key"; then
  -  sharedmem="1"
  -  keybased_shm="1"
  -  AC_MSG_RESULT(key based)
  -else
  -  AC_MSG_RESULT(no)
  -fi
  -AC_SUBST(sharedmem)
  -AC_SUBST(anonymous_shm)
  -AC_SUBST(filebased_shm)
  -AC_SUBST(keybased_shm)
   
   dnl #----------------------------- Checking for /dev/random 
   AC_MSG_CHECKING(for /dev/random)
  
  
  
  1.31      +10 -0     apache-2.0/src/lib/apr/include/apr.h.in
  
  Index: apr.h.in
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr.h.in,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- apr.h.in	2000/06/09 21:19:48	1.30
  +++ apr.h.in	2000/06/10 16:08:37	1.31
  @@ -46,6 +46,16 @@
   #define APR_USES_FILEBASED_SHM            @filebased_shm@
   #define APR_USES_KEYBASED_SHM             @keybased_shm@
   
  +/* These look VERY similar to the macro's above.  They aren't.  The
  + * difference is in implementation.  The above macros describe how to
  + * access the shared memory, either anonymously, through a key or through
  + * a file.  The macros defined below describe actually how the shared
  + * memory is actually implemented.  Is it actually a file that has been
  + * opened by multiple processes, or it is stored in memory somehow.  This
  + * is important for some optimizations in Apache.
  + */ 
  +#define APR_FILE_BASED_SHM      @file_based@
  +#define APR_MEM_BASED_SHM       @mem_based@
   
   #define APR_HAVE_IN_ADDR        @have_in_addr@
   #define APR_HAVE_INET_ADDR      @inet_addr@