Re: fails to compile dbm

2002-01-18 Thread Roy T. Fielding
That seems to fix it. +1

Roy


On Thu, Jan 17, 2002 at 04:15:19PM -0800, Greg Stein wrote:
 Urk... that is my fault. The DB_NOTFOUND is not in db1, which is apparently
 what you're including/linking against.  Please try this patch:
 
 Index: apr_dbm_berkeleydb.c
 ===
 RCS file: /home/cvs/apr-util/dbm/apr_dbm_berkeleydb.c,v
 retrieving revision 1.13
 diff -u -r1.13 apr_dbm_berkeleydb.c
 --- apr_dbm_berkeleydb.c  16 Jan 2002 08:56:22 -  1.13
 +++ apr_dbm_berkeleydb.c  18 Jan 2002 00:07:04 -
 @@ -250,7 +250,13 @@
  dberr = do_fetch(GET_BDB(dbm-file), ckey, rd);
  
  /* not found is not an error. return zero'd value. */
 -if (dberr == DB_NOTFOUND) {
 +if (dberr ==
 +#if DB_VER == 1
 +RET_SPECIAL
 +#else
 +DB_NOTFOUND
 +#endif
 +) {
  memset(rd, 0, sizeof(rd));
  dberr = 0;
  }
 
 
 I've also attached it.
 
 Cheers,
 -g
 
 On Thu, Jan 17, 2002 at 03:42:38PM -0800, Roy T. Fielding wrote:
  The build on Linux is broken at
  
  make[4]: Entering directory 
  `/home/fielding/ws/httpd-2.0/srclib/apr-util/dbm'
  /bin/sh /home/fielding/ws/httpd-2.0/srclib/apr/libtool --silent 
  --mode=compile gcc -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes 
  -Wmissing-declarations -pthread -Werror  -DHAVE_CONFIG_H -DLINUX=2 
  -D_REENTRANT -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE   
  -I/home/fielding/ws/httpd-2.0/srclib/apr-util/include 
  -I/home/fielding/ws/httpd-2.0/srclib/apr-util/include/private 
  -I/home/fielding/ws/httpd-2.0/srclib/apr-util/include 
  -I/home/fielding/ws/httpd-2.0/srclib/apr-util/include/private 
  -I/home/fielding/ws/httpd-2.0/srclib/apr/include  -c apr_dbm_berkeleydb.c 
   touch apr_dbm_berkeleydb.lo
  apr_dbm_berkeleydb.c: In function `vt_db_fetch':
  apr_dbm_berkeleydb.c:253: `DB_NOTFOUND' undeclared (first use in this 
  function)
  apr_dbm_berkeleydb.c:253: (Each undeclared identifier is reported only once
  apr_dbm_berkeleydb.c:253: for each function it appears in.)
  make[4]: *** [apr_dbm_berkeleydb.lo] Error 1
  make[4]: Leaving directory `/home/fielding/ws/httpd-2.0/srclib/apr-util/dbm'
  
  [EMAIL PROTECTED] uname -a
  Linux waka.ebuilt.net 2.2.16-22 #1 Tue Aug 22 16:16:55 EDT 2000 i586 unknown
  
  [EMAIL PROTECTED] more ./config.nice 
  #! /bin/sh
  #
  # Created by configure
  
  NOTEST_CFLAGS=-Werror; export NOTEST_CFLAGS
  ./configure \
  --enable-maintainer-mode \
  --prefix=/home/fielding/ws/test \
  --enable-modules=most \
  $@
  
  I think it is because this check in config.log works:
  
  configure:3100: gcc -c -g -O2 -Wall -Wmissing-prototypes 
  -Wstrict-prototypes -Wmissing-declarations -pthread -DLINUX=2 -D_REENTRANT 
  -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE -DAP_DEBUG 
  -I/usr/include/db1 conftest.c 15
  
  but the  -I/usr/include/db1  is not being saved for later use.
  
  Roy
 
 -- 
 Greg Stein, http://www.lyra.org/
 

 Index: apr_dbm_berkeleydb.c
 ===
 RCS file: /home/cvs/apr-util/dbm/apr_dbm_berkeleydb.c,v
 retrieving revision 1.13
 diff -u -r1.13 apr_dbm_berkeleydb.c
 --- apr_dbm_berkeleydb.c  16 Jan 2002 08:56:22 -  1.13
 +++ apr_dbm_berkeleydb.c  18 Jan 2002 00:07:04 -
 @@ -250,7 +250,13 @@
  dberr = do_fetch(GET_BDB(dbm-file), ckey, rd);
  
  /* not found is not an error. return zero'd value. */
 -if (dberr == DB_NOTFOUND) {
 +if (dberr ==
 +#if DB_VER == 1
 +RET_SPECIAL
 +#else
 +DB_NOTFOUND
 +#endif
 +) {
  memset(rd, 0, sizeof(rd));
  dberr = 0;
  }



RE: isatty?

2002-01-18 Thread Ryan Bloom
This should be easy to implement on Windows and Unix.  I would imagine
that it can also be done on BeOS and OS/2, so I would say let's get this
implemented ASAP.

Ryan

--
Ryan Bloom  [EMAIL PROTECTED]
645 Howard St.  [EMAIL PROTECTED]
San Francisco, CA 

 -Original Message-
 From: Doug MacEachern [mailto:[EMAIL PROTECTED]
 Sent: Thursday, January 17, 2002 6:27 PM
 To: dev@apr.apache.org
 Subject: isatty?
 
 i'd like to remove the global counter hack from mod_ssl that only
reads
 the passphrase on the first module init.  currently does so because
that
 is the only time httpd is still attached to the tty, but if
 SSLPassPhraseDialog is exec: rather than built in, a tty is not
required
 to read the passphrase.  but in the case of builtin, i need to know if
 stdout is connected to a tty.  i'm guessing that
isatty(fileno(stdout))
 is not portable.  thinking we'll need something like:
 
 apr_file_t *out;
 apr_file_open_stdout(out, pool);
 
 if (apr_file_isatty(out)) { ... }
 
 thoughts?




Re: cvs commit: httpd-2.0 configure.in

2002-01-18 Thread Justin Erenkrantz
On Fri, Jan 18, 2002 at 06:16:54PM -, [EMAIL PROTECTED] wrote:
 jerenkrantz02/01/18 10:16:54
 
   Modified:.configure.in
   Log:
   Per Ian's change, add the APRUTIL_EXPORT_INCLUDES vars to our environment.

I told Ian that I'd switch httpd-2.0 to use apu-config instead
(which is why he didn't change httpd-2.0 over).  However, I chickened
out because I'm not terribly happy with this segment in apu-config:

--libs)
if [ -f $PREFIX/lib/libexpat.la ] ; then
  TMP_SRCDIR=`echo $TOP_SRCDIR/xml/expat | sed 's/\\//\\//g'`
  TMP_PREFIX=`echo $PREFIX | sed 's/\\//\\//g'`
  LIBS=`echo $LIBS | sed s/$TMP_SRCDIR/$TMP_PREFIX/g`
fi
echo $LIBS
;;

The issue is that when APR-util is *not* installed, we want to tell
libtool to use the .la in our source directory, but if we *are*
installed, we want to use the .la in our installed location.
Currently, APRUTIL_EXPORT_LIBS points to the *full* source dir path
to expat.

So, if you have a previous installation of libexpat.la in 
$prefix/lib and use apu-config, we'll link to that instead of the 
one in the source dir.  This may not be ideal.

If anyone has any ideas, they'd be appreciated.  What is there now
is a bit of a hack.  It works, but...  -- justin



Re: Patch for apr-util/xml expat detection

2002-01-18 Thread Justin Erenkrantz
On Thu, Jan 17, 2002 at 11:35:06PM -0500, [EMAIL PROTECTED] wrote:
 Hmm, still no comment on my patch.  Is anyone interested in seeing
 --with-expat actually working?

Committed.  Ian actually just fixed the INCLUDES this morning,
so I just added the 1.95.x installed portion of your patch.

Sorry, but there are times when us developers are swamped and
patches seem to get lost.  If that happens, please just repost
it a week or so later (like you did!).

Thanks again.  -- justin



Re: [PATCH] apr_file_mktemp should APR_CREATE the tmp file

2002-01-18 Thread Justin Erenkrantz
On Tue, Jan 15, 2002 at 07:04:00PM -0800, [EMAIL PROTECTED] wrote:
 this patch fixes it... Also -

Committed.  Thanks!

 should it really DELONCLOSE by default?  I don't think that's consistent
 with most implementations of mkstemp - worst case we should document it
 (and since the consumer can pass their own flags its not a big deal).

Yeah, I agree that it is different, but I'm not entirely sure that 
it is the wrong thing to do.  I think if you have a temp-file, you 
want to delete it by *default*.  Since a user can override those
flags, I think it's NBD as well.  -- justin



[PATCH] --with-berkley-db option to apr-util

2002-01-18 Thread Ian Holsman
can you guys please confirm that this works on your 
platforms/configurations.
I'll be commiting this in tomorrow if no one squeaks.

..Ian
Index: build/apu-conf.m4
===
RCS file: /home/cvs/apr-util/build/apu-conf.m4,v
retrieving revision 1.28
diff -u -u -r1.28 apu-conf.m4
--- build/apu-conf.m4   18 Jan 2002 19:07:05 -  1.28
+++ build/apu-conf.m4   18 Jan 2002 21:20:57 -
@@ -158,6 +158,32 @@
 fi
 ])
+AC_DEFUN(APU_CHECK_BERKELEY_DB,[
+if test $apu_want_db != 0; then
+  APU_CHECK_DB4
+  if test $apu_db_version != 4; then
+APU_CHECK_DB3
+if test $apu_db_version != 3; then
+  APU_CHECK_DB2
+  if test $apu_db_version != 2; then
+APU_CHECK_DB1
+if test $apu_db_version != 1; then
+  APU_CHECK_DB185
+fi
+  fi
+fi
+  fi
+fi
+AC_MSG_CHECKING(for Berkeley DB)
+if test $apu_db_version != 0; then
+  apu_have_db=1
+  AC_MSG_RESULT(found db$apu_db_version)
+else
+  AC_MSG_RESULT(not found)
+fi
+
+
+])
 dnl
 dnl APU_CHECK_DBM: see what kind of DBM backend to use for apr_dbm.
 dnl
@@ -209,30 +235,48 @@
 dnl We're going to try to find the highest version of Berkeley DB 
supported.
-APU_CHECK_DB4
-if test $apu_db_version != 4; then
-  APU_CHECK_DB3
-  if test $apu_db_version != 3; then
-APU_CHECK_DB2
-if test $apu_db_version != 2; then
-  APU_CHECK_DB1
-  if test $apu_db_version != 1; then
-APU_CHECK_DB185
-  fi
-fi
-  fi
-fi
+AC_ARG_WITH([berkeley-db],
+[--with-berkeley-db=PATH
+ Find the Berkeley DB header and library in \`PATH/include' and
+\`PATH/lib'.  If PATH is of the form \`HEADER:LIB', then search
+for header files in HEADER, and the library in LIB.  If you omit
+the \`=PATH' part completely, the configure script will search
+for Berkeley DB in a number of standard places.
+], [
+   if test $withval = yes; then
+  apu_want_db=1
+  BDB_INC=
+  BDB_LIB=
+elif test $withval = no; then
+  apu_want_db=0
+else
+  apu_want_db=1
+  case $withval in
+*:*)
+  BDB_INC=-I`echo $withval |sed -e 's/:.*$//'`
+  BDB_LIB=-L`echo $withval |sed -e 's/^.*://'`
+;;
+*)
+  BDB_INC=-I$withval/include
+  BDB_LIB=-L$withval/lib
+;;
+  esac
+  AC_MSG_RESULT(looking for berkeley-db includes with $BDB_INC)
+  AC_MSG_RESULT(looking for berkeley-db libs with $BDB_LIB)
+fi
+CPPFLAGS=$BDB_INC
+LIBS=$BDB_LIB
+if test $apu_want_db != 0; then
+APU_CHECK_BERKELEY_DB
+if test $withval != yes; then
+APR_ADDTO( APRUTIL_INCLUDES, [$BDB_INC])
+APR_ADDTO( APRUTIL_EXPORT_LIBS, [$BDB_LIB])
+fi
+fi
+],[
+APU_CHECK_BERKELEY_DB
+])

-dnl Yes, it'd be nice if we could collate the output in an order
-dnl so that the AC_MSG_CHECKING would be output before the actual
-dnl checks, but it isn't happening now.
-AC_MSG_CHECKING(for Berkeley DB)
-if test $apu_db_version != 0; then
-  apu_have_db=1
-  AC_MSG_RESULT(found db$apu_db_version)
-else
-  AC_MSG_RESULT(not found)
-fi
 dnl Note that we may have found db3, but the user wants db1.  So, check
 dnl explicitly for db1 in this case.  Unfortunately, this means
@@ -256,6 +300,8 @@
 fi
 ;;
   db1)
+CPPFLAGS=$BDB_INC
+LIBS=$BDB_LIB
 APU_CHECK_DB1
 if test $apu_db_version = 1; then
   apu_use_db=1
@@ -265,6 +311,8 @@
 fi
 ;;
   db185)
+CPPFLAGS=$BDB_INC
+LIBS=$BDB_LIB
 APU_CHECK_DB185
 if test $apu_db_version = 185; then
   apu_use_db=1
@@ -274,6 +322,8 @@
 fi
 ;;
   db2)
+CPPFLAGS=$BDB_INC
+LIBS=$BDB_LIB
 APU_CHECK_DB2
 if test $apu_db_version = 2; then
   apu_use_db=1
@@ -283,6 +333,8 @@
 fi
 ;;
   db3)
+CPPFLAGS=$BDB_INC
+LIBS=$BDB_LIB
 APU_CHECK_DB3
 if test $apu_db_version = 3; then
   apu_use_db=1
@@ -292,6 +344,8 @@
 fi
 ;;
   db4)
+CPPFLAGS=$BDB_INC
+LIBS=$BDB_LIB
 APU_CHECK_DB4
 if test $apu_db_version = 4; then
   apu_use_db=1
Index: build/apu-conf.m4
===
RCS file: /home/cvs/apr-util/build/apu-conf.m4,v
retrieving revision 1.28
diff -u -u -r1.28 apu-conf.m4
--- build/apu-conf.m4   18 Jan 2002 19:07:05 -  1.28
+++ build/apu-conf.m4   18 Jan 2002 21:20:57 -
@@ -158,6 +158,32 @@
 fi
 ])
 
+AC_DEFUN(APU_CHECK_BERKELEY_DB,[
+if test $apu_want_db != 0; then
+  APU_CHECK_DB4
+  if test $apu_db_version != 4; then
+APU_CHECK_DB3
+if test $apu_db_version != 3; then
+  APU_CHECK_DB2
+  if test $apu_db_version != 2; then
+APU_CHECK_DB1
+if test $apu_db_version != 1; then
+  APU_CHECK_DB185
+fi
+  fi
+fi
+  fi
+fi
+AC_MSG_CHECKING(for Berkeley DB)
+if test $apu_db_version != 0; then
+  apu_have_db=1
+  AC_MSG_RESULT(found db$apu_db_version)
+else
+  AC_MSG_RESULT(not found)
+fi
+
+
+])
 dnl
 dnl