From: Jeff Trawick Date: Wed, 4 Nov 2009 23:35:30 +0000 (+0000) Subject: tweak MPM configure to avoid having to grep for MPM names in lists X-Git-Tag: 2.3.3~47 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=afe02c5efa1b2d2591a7c57851de39293b532332;p=apache tweak MPM configure to avoid having to grep for MPM names in lists of MPMs of some type (threaded or share-able or enabled), as suggested by jorton rename some MPM-related variables git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@832907 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/mpm/config.m4 b/server/mpm/config.m4 index 27075a14f4..e7b47aad24 100644 --- a/server/mpm/config.m4 +++ b/server/mpm/config.m4 @@ -41,12 +41,14 @@ esac dnl APACHE_MPM_SUPPORTED(name, supports-shared, is_threaded) AC_DEFUN(APACHE_MPM_SUPPORTED,[ - SUPPORTED_MPMS="$SUPPORTED_MPMS $1 " if test "$2" = "yes"; then - SHARED_MPMS="$SHARED_MPMS $1 " + eval "ap_supported_mpm_$1=shared" + ap_supported_shared_mpms="$ap_supported_shared_mpms $1 " + else + eval "ap_supported_mpm_$1=static" fi if test "$3" = "yes"; then - THREADED_MPMS="$THREADED_MPMS $1 " + eval "ap_threaded_mpm_$1=yes" fi ])dnl @@ -55,22 +57,25 @@ AC_DEFUN(APACHE_MPM_ENABLED,[ if ap_mpm_is_enabled $1; then : else - ENABLED_MPMS="$ENABLED_MPMS $1 " + eval "ap_enabled_mpm_$1=yes" + ap_enabled_mpms="$ap_enabled_mpms $1 " fi ])dnl ap_mpm_is_supported () { - if echo "$SUPPORTED_MPMS" | grep " $1 " >/dev/null; then - return 0 - else + eval "tmp=\$ap_supported_mpm_$1" + if test -z "$tmp"; then return 1 + else + return 0 fi } ap_mpm_supports_shared () { - if echo "$SHARED_MPMS" | grep " $1 " >/dev/null; then + eval "tmp=\$ap_supported_mpm_$1" + if test "$tmp" = "shared"; then return 0 else return 1 @@ -83,8 +88,9 @@ ap_mpm_is_threaded () return 0 fi - for mpm in $ENABLED_MPMS; do - if echo "$THREADED_MPMS" | grep " $mpm " >/dev/null; then + for mpm in $ap_enabled_mpms; do + eval "tmp=\$ap_threaded_mpm_$mpm" + if test "$tmp" = "yes"; then return 0 fi done @@ -93,7 +99,8 @@ ap_mpm_is_threaded () ap_mpm_is_enabled () { - if echo "$ENABLED_MPMS" | grep " $1 " >/dev/null; then + eval "tmp=\$ap_enabled_mpm_$1" + if test "$tmp" = "yes"; then return 0 else return 1 diff --git a/server/mpm/config2.m4 b/server/mpm/config2.m4 index 5e15554690..76a04e4a7b 100644 --- a/server/mpm/config2.m4 +++ b/server/mpm/config2.m4 @@ -36,7 +36,7 @@ APACHE_HELP_STRING(--enable-mpms-shared=MPM-LIST,Space-separated list of MPM mod mpm_build=shared for i in $enableval; do if test "$i" = "all"; then - for j in $SHARED_MPMS; do + for j in $ap_supported_shared_mpms; do eval "enable_mpm_$j=shared" APACHE_MPM_ENABLED($j) done @@ -52,7 +52,7 @@ APACHE_HELP_STRING(--enable-mpms-shared=MPM-LIST,Space-separated list of MPM mod done ], [mpm_build=static]) -for i in $ENABLED_MPMS; do +for i in $ap_enabled_mpms; do if ap_mpm_is_supported $i; then : else @@ -76,6 +76,6 @@ else MODLIST="$MODLIST mpm_${default_mpm}" fi -MPM_SUBDIRS=$ENABLED_MPMS +MPM_SUBDIRS=$ap_enabled_mpms APACHE_SUBST(MPM_SUBDIRS) APACHE_SUBST(MPM_LIB)