You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Joe Orton <jo...@light.plus.com> on 2000/11/01 00:13:23 UTC

Re: [PATCH] configuring APR threads fix

On Tue, Oct 31, 2000 at 08:57:00AM -0800, Ryan Bloom wrote:
> On Mon, 30 Oct 2000, Joe Orton wrote:
> > The APR configure script seems to be caching whether --enable-threads
> > was passed, which is confusing. This fixes that and simplifies a bit,
> > replacing the cache variable and enable_apr_threads with a single
> > enable_threads variable:
> 
> I realize that this is confusing, but it is also correct.  The problem is
> that we have to be able to decide based on which MPM was chosen how to
> configure APR.  For example, if Apache uses the prefork MPM, then we don't
> want threads, but if Apache uses mpmt_pthread or dexter or perchild, then
> we do want threads.  I have not been able to find a way to force APR to be
> configured differently based on how Apache is configured unless Apache
> sets a condition in the cache.

How about this?

Index: configure.in
===================================================================
RCS file: /home/joe/lib/cvsroot/apache2/src/configure.in,v
retrieving revision 1.82
diff -u -r1.82 configure.in
--- configure.in	2000/10/27 21:54:28	1.82
+++ configure.in	2000/10/31 22:32:23
@@ -205,7 +205,7 @@
 dnl ## APRVARS before Apache generates it's Makefiles and the related files.
 dnl ## This allows APR to detect libraries like dl and tell Apache that it
 dnl ## needs to include or not include them.
-RUN_SUBDIR_CONFIG_NOW(lib/apr)
+RUN_SUBDIR_CONFIG_NOW(lib/apr, $apache_apr_flags)
 RUN_SUBDIR_CONFIG_NOW(lib/pcre)
 . ./lib/apr/APRVARS
 
Index: modules/mpm/beos/config.m4
===================================================================
RCS file: /home/joe/lib/cvsroot/apache2/src/modules/mpm/beos/config.m4,v
retrieving revision 1.1
diff -u -r1.1 config.m4
--- modules/mpm/beos/config.m4	2000/06/20 14:30:00	1.1
+++ modules/mpm/beos/config.m4	2000/10/31 22:38:17
@@ -1,8 +1,7 @@
 dnl ## XXX - Need a more thorough check of the proper flags to use
 
 if test "$MPM_NAME" = "beos" ; then
-    ac_cv_enable_threads="yes"
-    AC_CACHE_SAVE
+    apache_apr_flags="--enable-threads"
 
     APACHE_FAST_OUTPUT(modules/mpm/$MPM_NAME/Makefile)
 fi
Index: modules/mpm/dexter/config.m4
===================================================================
RCS file: /home/joe/lib/cvsroot/apache2/src/modules/mpm/dexter/config.m4,v
retrieving revision 1.4
diff -u -r1.4 config.m4
--- modules/mpm/dexter/config.m4	2000/06/13 01:08:19	1.4
+++ modules/mpm/dexter/config.m4	2000/10/31 22:38:52
@@ -1,8 +1,7 @@
 dnl ## XXX - Need a more thorough check of the proper flags to use
 
 if test "$MPM_NAME" = "dexter" ; then
-    ac_cv_enable_threads="yes"
-    AC_CACHE_SAVE
+    apache_apr_flags="--enable-threads"
 
     APACHE_FAST_OUTPUT(modules/mpm/$MPM_NAME/Makefile)
     APACHE_MPM_PTHREAD
Index: modules/mpm/mpmt_beos/config.m4
===================================================================
RCS file: /home/joe/lib/cvsroot/apache2/src/modules/mpm/mpmt_beos/config.m4,v
retrieving revision 1.1
diff -u -r1.1 config.m4
--- modules/mpm/mpmt_beos/config.m4	2000/02/07 12:02:59	1.1
+++ modules/mpm/mpmt_beos/config.m4	2000/10/31 22:40:04
@@ -1,8 +1,7 @@
 dnl ## XXX - Need a more thorough check of the proper flags to use
 
 if test "$MPM_NAME" = "mpmt_beos" ; then
-    ac_cv_enable_threads="yes"
-    AC_CACHE_SAVE
+    apache_apr_flags="--enable-threads"
 
     APACHE_FAST_OUTPUT(modules/mpm/$MPM_NAME/Makefile)
 fi
Index: modules/mpm/mpmt_pthread/config.m4
===================================================================
RCS file: /home/joe/lib/cvsroot/apache2/src/modules/mpm/mpmt_pthread/config.m4,v
retrieving revision 1.7
diff -u -r1.7 config.m4
--- modules/mpm/mpmt_pthread/config.m4	2000/08/02 00:56:28	1.7
+++ modules/mpm/mpmt_pthread/config.m4	2000/10/31 22:39:16
@@ -1,8 +1,7 @@
 dnl ## XXX - Need a more thorough check of the proper flags to use
 
 if test "$MPM_NAME" = "mpmt_pthread" ; then
-    ac_cv_enable_threads="yes"
-    AC_CACHE_SAVE
+    apache_apr_flags="--enable-threads"
 
     APACHE_FAST_OUTPUT(modules/mpm/$MPM_NAME/Makefile)
 
Index: modules/mpm/perchild/config.m4
===================================================================
RCS file: /home/joe/lib/cvsroot/apache2/src/modules/mpm/perchild/config.m4,v
retrieving revision 1.1
diff -u -r1.1 config.m4
--- modules/mpm/perchild/config.m4	2000/07/27 00:16:31	1.1
+++ modules/mpm/perchild/config.m4	2000/10/31 22:38:31
@@ -1,8 +1,7 @@
 dnl ## XXX - Need a more thorough check of the proper flags to use
 
 if test "$MPM_NAME" = "perchild" ; then
-    ac_cv_enable_threads="yes"
-    AC_CACHE_SAVE
+    apache_apr_flags="--enable-threads"
 
     APACHE_FAST_OUTPUT(modules/mpm/$MPM_NAME/Makefile)
     APACHE_MPM_PTHREAD
Index: modules/mpm/prefork/config.m4
===================================================================
RCS file: /home/joe/lib/cvsroot/apache2/src/modules/mpm/prefork/config.m4,v
retrieving revision 1.5
diff -u -r1.5 config.m4
--- modules/mpm/prefork/config.m4	2000/06/13 01:08:20	1.5
+++ modules/mpm/prefork/config.m4	2000/10/31 22:33:50
@@ -1,7 +1,6 @@
 if test "$MPM_NAME" = "prefork" ; then
 dnl Turn off all threading functions in APR
-    ac_cv_enable_threads="no"
-    AC_CACHE_SAVE
+    apache_apr_flags="--disable-threads"
 
     APACHE_FAST_OUTPUT(modules/mpm/$MPM_NAME/Makefile)
 

Re: [PATCH] configuring APR threads fix

Posted by Greg Stein <gs...@lyra.org>.
I've applied this patch and the original patch. This is much better than
what we had before, and it also allows Apache to have much finer grained
control over what is happening within the APR config.
[ and makes it easier for us to resolve the question of allowing threads to
  be present when the prefork MPM is configured ]

Thanks for the patch, Joe.

[ I'm also hoping this will fix a problem that I'm seeing in APR regarding
  threading and how the thread flags are exported via APRVARs... still
  tracking that, tho ]

Cheers,
-g

On Tue, Oct 31, 2000 at 11:13:23PM +0000, Joe Orton wrote:
> On Tue, Oct 31, 2000 at 08:57:00AM -0800, Ryan Bloom wrote:
> > On Mon, 30 Oct 2000, Joe Orton wrote:
> > > The APR configure script seems to be caching whether --enable-threads
> > > was passed, which is confusing. This fixes that and simplifies a bit,
> > > replacing the cache variable and enable_apr_threads with a single
> > > enable_threads variable:
> > 
> > I realize that this is confusing, but it is also correct.  The problem is
> > that we have to be able to decide based on which MPM was chosen how to
> > configure APR.  For example, if Apache uses the prefork MPM, then we don't
> > want threads, but if Apache uses mpmt_pthread or dexter or perchild, then
> > we do want threads.  I have not been able to find a way to force APR to be
> > configured differently based on how Apache is configured unless Apache
> > sets a condition in the cache.
> 
> How about this?
> 
> Index: configure.in
> ===================================================================
> RCS file: /home/joe/lib/cvsroot/apache2/src/configure.in,v
> retrieving revision 1.82
> diff -u -r1.82 configure.in
> --- configure.in	2000/10/27 21:54:28	1.82
> +++ configure.in	2000/10/31 22:32:23
> @@ -205,7 +205,7 @@
>  dnl ## APRVARS before Apache generates it's Makefiles and the related files.
>  dnl ## This allows APR to detect libraries like dl and tell Apache that it
>  dnl ## needs to include or not include them.
> -RUN_SUBDIR_CONFIG_NOW(lib/apr)
> +RUN_SUBDIR_CONFIG_NOW(lib/apr, $apache_apr_flags)
>  RUN_SUBDIR_CONFIG_NOW(lib/pcre)
>  . ./lib/apr/APRVARS
>  
> Index: modules/mpm/beos/config.m4
> ===================================================================
> RCS file: /home/joe/lib/cvsroot/apache2/src/modules/mpm/beos/config.m4,v
> retrieving revision 1.1
> diff -u -r1.1 config.m4
> --- modules/mpm/beos/config.m4	2000/06/20 14:30:00	1.1
> +++ modules/mpm/beos/config.m4	2000/10/31 22:38:17
> @@ -1,8 +1,7 @@
>  dnl ## XXX - Need a more thorough check of the proper flags to use
>  
>  if test "$MPM_NAME" = "beos" ; then
> -    ac_cv_enable_threads="yes"
> -    AC_CACHE_SAVE
> +    apache_apr_flags="--enable-threads"
>  
>      APACHE_FAST_OUTPUT(modules/mpm/$MPM_NAME/Makefile)
>  fi
> Index: modules/mpm/dexter/config.m4
> ===================================================================
> RCS file: /home/joe/lib/cvsroot/apache2/src/modules/mpm/dexter/config.m4,v
> retrieving revision 1.4
> diff -u -r1.4 config.m4
> --- modules/mpm/dexter/config.m4	2000/06/13 01:08:19	1.4
> +++ modules/mpm/dexter/config.m4	2000/10/31 22:38:52
> @@ -1,8 +1,7 @@
>  dnl ## XXX - Need a more thorough check of the proper flags to use
>  
>  if test "$MPM_NAME" = "dexter" ; then
> -    ac_cv_enable_threads="yes"
> -    AC_CACHE_SAVE
> +    apache_apr_flags="--enable-threads"
>  
>      APACHE_FAST_OUTPUT(modules/mpm/$MPM_NAME/Makefile)
>      APACHE_MPM_PTHREAD
> Index: modules/mpm/mpmt_beos/config.m4
> ===================================================================
> RCS file: /home/joe/lib/cvsroot/apache2/src/modules/mpm/mpmt_beos/config.m4,v
> retrieving revision 1.1
> diff -u -r1.1 config.m4
> --- modules/mpm/mpmt_beos/config.m4	2000/02/07 12:02:59	1.1
> +++ modules/mpm/mpmt_beos/config.m4	2000/10/31 22:40:04
> @@ -1,8 +1,7 @@
>  dnl ## XXX - Need a more thorough check of the proper flags to use
>  
>  if test "$MPM_NAME" = "mpmt_beos" ; then
> -    ac_cv_enable_threads="yes"
> -    AC_CACHE_SAVE
> +    apache_apr_flags="--enable-threads"
>  
>      APACHE_FAST_OUTPUT(modules/mpm/$MPM_NAME/Makefile)
>  fi
> Index: modules/mpm/mpmt_pthread/config.m4
> ===================================================================
> RCS file: /home/joe/lib/cvsroot/apache2/src/modules/mpm/mpmt_pthread/config.m4,v
> retrieving revision 1.7
> diff -u -r1.7 config.m4
> --- modules/mpm/mpmt_pthread/config.m4	2000/08/02 00:56:28	1.7
> +++ modules/mpm/mpmt_pthread/config.m4	2000/10/31 22:39:16
> @@ -1,8 +1,7 @@
>  dnl ## XXX - Need a more thorough check of the proper flags to use
>  
>  if test "$MPM_NAME" = "mpmt_pthread" ; then
> -    ac_cv_enable_threads="yes"
> -    AC_CACHE_SAVE
> +    apache_apr_flags="--enable-threads"
>  
>      APACHE_FAST_OUTPUT(modules/mpm/$MPM_NAME/Makefile)
>  
> Index: modules/mpm/perchild/config.m4
> ===================================================================
> RCS file: /home/joe/lib/cvsroot/apache2/src/modules/mpm/perchild/config.m4,v
> retrieving revision 1.1
> diff -u -r1.1 config.m4
> --- modules/mpm/perchild/config.m4	2000/07/27 00:16:31	1.1
> +++ modules/mpm/perchild/config.m4	2000/10/31 22:38:31
> @@ -1,8 +1,7 @@
>  dnl ## XXX - Need a more thorough check of the proper flags to use
>  
>  if test "$MPM_NAME" = "perchild" ; then
> -    ac_cv_enable_threads="yes"
> -    AC_CACHE_SAVE
> +    apache_apr_flags="--enable-threads"
>  
>      APACHE_FAST_OUTPUT(modules/mpm/$MPM_NAME/Makefile)
>      APACHE_MPM_PTHREAD
> Index: modules/mpm/prefork/config.m4
> ===================================================================
> RCS file: /home/joe/lib/cvsroot/apache2/src/modules/mpm/prefork/config.m4,v
> retrieving revision 1.5
> diff -u -r1.5 config.m4
> --- modules/mpm/prefork/config.m4	2000/06/13 01:08:20	1.5
> +++ modules/mpm/prefork/config.m4	2000/10/31 22:33:50
> @@ -1,7 +1,6 @@
>  if test "$MPM_NAME" = "prefork" ; then
>  dnl Turn off all threading functions in APR
> -    ac_cv_enable_threads="no"
> -    AC_CACHE_SAVE
> +    apache_apr_flags="--disable-threads"
>  
>      APACHE_FAST_OUTPUT(modules/mpm/$MPM_NAME/Makefile)
>  

-- 
Greg Stein, http://www.lyra.org/