Re: [PATCH] controlling the flavor of lock used by APR

2000-11-30 Thread Jeff Trawick
[EMAIL PROTECTED] writes:

> On 30 Nov 2000, Jeff Trawick wrote:
> 
> > Important note: the hints.m4 change is just an example...  I won't
> > commit a change for Linux, but will do so for OS/390 before I
> > commit... 
> 
> Please use the APR_SETVAR syntax for setting variables in hints.m4.  This
> keeps everything looking the same.

yep, that looks better...

I'll use APR_SETIFNULL so that the user can tweak the lock mechanism
without changing hints.m4 (e.g., 
"apr_lock_method=USE_FLOCK_SERIALIZE ./configure --whatever"). 

e.g., APR_SETIFNULL(apr_lock_method, [USE_SYSVSEM_SERIALIZE])

> >  AC_CHECK_DEFINE(PTHREAD_PROCESS_SHARED, pthread.h)
> >  fi
> >  
> > -AC_BEGIN_DECISION([ap_lock implementation method])
> > +AC_BEGIN_DECISION([apr_lock implementation method])
> >  AC_IFALLYES(custom:union_semun,
> >  AC_DECIDE(USE_SYSVSEM_SERIALIZE, [SysV IPC semget()]))
> >  AC_IFALLYES(header:sys/file.h define:LOCK_EX,
> > @@ -627,7 +627,9 @@
> >  AC_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl
> >  custom:with_pthread_cross,
> >  AC_DECIDE(USE_PROC_PTHREAD_SERIALIZE, [pthread mutex]))
> > -dnl AC_DECISION_FORCE(USE_FCNTL_SERIALIZE)
> > +if test "x$apr_lock_method" != "x"; then
> > +AC_DECISION_FORCE($apr_lock_method)
> > +fi
> >  AC_END_DECISION
> >  AC_DEFINE_UNQUOTED($ac_decision)
> 
> Do we want a default method?  For example, the USE_xxx_SERIALIZE option
> isn't set in hints.m4, and autoconf can't figure out what to use,
> shouldn't we default to FCNTL?  Looking at the current code, this looks
> broken, but we probably shouldn't propogate the problem.

With the current code, we should get an error message and abort
configuration from this generated logic:

if test ".$ac_decision" = .; then
echo "$0:Error: decision on $ac_decision_item failed" 1>&2
exit 1
else

The current behavior seems like a good thing.  We could default to
fcntl() instead, but we weren't able to find the declarations we
needed to code fcntl() so we're likely to fail to compile crossproc.c
anyway.

Have fun,

-- 
Jeff Trawick | [EMAIL PROTECTED] | PGP public key at web site:
 http://www.geocities.com/SiliconValley/Park/9289/
  Born in Roswell... married an alien...


Re: [PATCH] controlling the flavor of lock used by APR

2000-11-30 Thread rbb
On 30 Nov 2000, Jeff Trawick wrote:

> Important note: the hints.m4 change is just an example...  I won't
> commit a change for Linux, but will do so for OS/390 before I
> commit... 

Please use the APR_SETVAR syntax for setting variables in hints.m4.  This
keeps everything looking the same.

>  AC_CHECK_DEFINE(PTHREAD_PROCESS_SHARED, pthread.h)
>  fi
>  
> -AC_BEGIN_DECISION([ap_lock implementation method])
> +AC_BEGIN_DECISION([apr_lock implementation method])
>  AC_IFALLYES(custom:union_semun,
>  AC_DECIDE(USE_SYSVSEM_SERIALIZE, [SysV IPC semget()]))
>  AC_IFALLYES(header:sys/file.h define:LOCK_EX,
> @@ -627,7 +627,9 @@
>  AC_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl
>  custom:with_pthread_cross,
>  AC_DECIDE(USE_PROC_PTHREAD_SERIALIZE, [pthread mutex]))
> -dnl AC_DECISION_FORCE(USE_FCNTL_SERIALIZE)
> +if test "x$apr_lock_method" != "x"; then
> +AC_DECISION_FORCE($apr_lock_method)
> +fi
>  AC_END_DECISION
>  AC_DEFINE_UNQUOTED($ac_decision)

Do we want a default method?  For example, the USE_xxx_SERIALIZE option
isn't set in hints.m4, and autoconf can't figure out what to use,
shouldn't we default to FCNTL?  Looking at the current code, this looks
broken, but we probably shouldn't propogate the problem.

Ryan
___
Ryan Bloom  [EMAIL PROTECTED]
406 29th St.
San Francisco, CA 94131
---



[PATCH] controlling the flavor of lock used by APR

2000-11-30 Thread Jeff Trawick
Important note: the hints.m4 change is just an example...  I won't
commit a change for Linux, but will do so for OS/390 before I
commit... 

To tailor the lock method, in hints.m4 set the apr_lock_method
variable to one of the USE_xxx_SERIALIZE symbols and magic will
happen.

Any remaining concerns before I commit?

Index: hints.m4 - JUST AN EXAMPLE 
===
RCS file: /home/cvspublic/apr/hints.m4,v
retrieving revision 1.25
diff -u -r1.25 hints.m4
--- hints.m42000/11/28 22:43:00 1.25
+++ hints.m42000/11/30 18:00:53
@@ -100,6 +100,7 @@
APR_SETIFNULL(LIBS, [-lm])
;;
 *-linux-*)
+apr_lock_method="USE_SYSVSEM_SERIALIZE"
 case `uname -r` in
2.2* ) APR_SETIFNULL(CFLAGS, [-DLINUX=2])
   APR_SETIFNULL(LIBS, [-lm])
Index: configure.in
===
RCS file: /home/cvspublic/apr/configure.in,v
retrieving revision 1.175
diff -u -r1.175 configure.in
--- configure.in2000/11/29 19:35:52 1.175
+++ configure.in2000/11/30 18:00:54
@@ -617,7 +617,7 @@
 AC_CHECK_DEFINE(PTHREAD_PROCESS_SHARED, pthread.h)
 fi
 
-AC_BEGIN_DECISION([ap_lock implementation method])
+AC_BEGIN_DECISION([apr_lock implementation method])
 AC_IFALLYES(custom:union_semun,
 AC_DECIDE(USE_SYSVSEM_SERIALIZE, [SysV IPC semget()]))
 AC_IFALLYES(header:sys/file.h define:LOCK_EX,
@@ -627,7 +627,9 @@
 AC_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl
 custom:with_pthread_cross,
 AC_DECIDE(USE_PROC_PTHREAD_SERIALIZE, [pthread mutex]))
-dnl AC_DECISION_FORCE(USE_FCNTL_SERIALIZE)
+if test "x$apr_lock_method" != "x"; then
+AC_DECISION_FORCE($apr_lock_method)
+fi
 AC_END_DECISION
 AC_DEFINE_UNQUOTED($ac_decision)
 

-- 
Jeff Trawick | [EMAIL PROTECTED] | PGP public key at web site:
 http://www.geocities.com/SiliconValley/Park/9289/
  Born in Roswell... married an alien...