From 70e07dc6cf985d0578c6de5d6ce60cccd91cdeea Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 3 Apr 2001 18:37:18 +0000 Subject: [PATCH] Make Apache check APR's configuration when determining the default MPM. This way, if APR is built without threads, then Apache defaults to the prefork MPM. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88695 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 18 ++++++------------ server/mpm/config.m4 | 18 +++--------------- .../perchild/config5.m4} | 1 - server/mpm/perchild/config5.m4 | 6 ++++++ server/mpm/spmt_os2/{config.m4 => config5.m4} | 0 server/mpm/threaded/{config.m4 => config5.m4} | 4 ---- 6 files changed, 15 insertions(+), 32 deletions(-) rename server/mpm/{perchild/config.m4 => experimental/perchild/config5.m4} (87%) create mode 100644 server/mpm/perchild/config5.m4 rename server/mpm/spmt_os2/{config.m4 => config5.m4} (100%) rename server/mpm/threaded/{config.m4 => config5.m4} (86%) diff --git a/configure.in b/configure.in index a749ea0b3b..3ccb8393fc 100644 --- a/configure.in +++ b/configure.in @@ -21,6 +21,12 @@ sinclude(srclib/apr/build/libtool.m4) sinclude(hints.m4) sinclude(acinclude.m4) +dnl ## Run configure for packages Apache uses +APR_SUBDIR_CONFIG(srclib/apr, "$apache_apr_flags --disable-shared") +APR_SUBDIR_CONFIG(srclib/apr-util, "--with-apr=../apr --disable-shared") +APR_SUBDIR_CONFIG(srclib/pcre) +. ./srclib/apr/APRVARS + dnl Generate ./config.nice for reproducing runs of configure dnl APR_CONFIG_NICE(config.nice) @@ -268,18 +274,6 @@ if test -d ./test; then APACHE_FAST_OUTPUT(test/Makefile) fi -dnl ## Run configure for packages Apache uses -dnl ## This has been placed at this location for a reason. This allows -dnl ## Apache to set some variable that APR needs (like whether to enable -dnl ## or disable threads), while still allowing APR to run and generate -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. -APR_SUBDIR_CONFIG(srclib/apr, "$apache_apr_flags --disable-shared") -APR_SUBDIR_CONFIG(srclib/apr-util, "--with-apr=../apr --disable-shared") -APR_SUBDIR_CONFIG(srclib/pcre) -. ./srclib/apr/APRVARS - dnl get the exported vars from APRUTIL . ./srclib/apr-util/export_vars.sh EXTRA_LIBS="$EXTRA_LIBS $APRUTIL_EXPORT_LIBS" diff --git a/server/mpm/config.m4 b/server/mpm/config.m4 index a2798cfccc..9d2c3fba6a 100644 --- a/server/mpm/config.m4 +++ b/server/mpm/config.m4 @@ -13,12 +13,10 @@ AC_MSG_RESULT($APACHE_MPM) apache_cv_mpm=$APACHE_MPM if test "$apache_cv_mpm" = "threaded" -o "$apache_cv_mpm" = "perchild"; then - APR_PTHREADS_CHECK - AC_MSG_CHECKING([for which threading library to use]) - AC_MSG_RESULT($threads_result) + APR_CHECK_APR_DEFINE(APR_HAS_THREADS, srclib/apr) - if test "$pthreads_working" = "no"; then - AC_MSG_RESULT(The currently selected MPM requires pthreads which your system seems to lack) + if test "x$ac_cv_define_APR_HAS_THREADS" = "xno"; then + AC_MSG_RESULT(The currently selected MPM requires threads which your system seems to lack) AC_MSG_CHECKING(checking for replacement) AC_MSG_RESULT(prefork selected) apache_cv_mpm=prefork @@ -34,13 +32,3 @@ MPM_LIB=$MPM_DIR/lib${MPM_NAME}.la APACHE_SUBST(MPM_NAME) MODLIST="$MODLIST mpm_${MPM_NAME}" -dnl Check for pthreads and attempt to support it -AC_DEFUN(APACHE_MPM_PTHREAD, [ - if test "$pthreads_working" != "yes"; then - AC_MSG_ERROR(This MPM requires pthreads. Try --with-mpm=prefork.) - fi - - dnl User threads libraries need pthread.h included everywhere - AC_DEFINE(PTHREAD_EVERYWHERE,, - [Define if all code should have #include ]) -]) diff --git a/server/mpm/perchild/config.m4 b/server/mpm/experimental/perchild/config5.m4 similarity index 87% rename from server/mpm/perchild/config.m4 rename to server/mpm/experimental/perchild/config5.m4 index 355cc3ca41..bd179baed9 100644 --- a/server/mpm/perchild/config.m4 +++ b/server/mpm/experimental/perchild/config5.m4 @@ -3,5 +3,4 @@ dnl ## XXX - Need a more thorough check of the proper flags to use if test "$MPM_NAME" = "perchild" ; then APACHE_FAST_OUTPUT(server/mpm/$MPM_NAME/Makefile) - APACHE_MPM_PTHREAD fi diff --git a/server/mpm/perchild/config5.m4 b/server/mpm/perchild/config5.m4 new file mode 100644 index 0000000000..bd179baed9 --- /dev/null +++ b/server/mpm/perchild/config5.m4 @@ -0,0 +1,6 @@ +dnl ## XXX - Need a more thorough check of the proper flags to use + +if test "$MPM_NAME" = "perchild" ; then + + APACHE_FAST_OUTPUT(server/mpm/$MPM_NAME/Makefile) +fi diff --git a/server/mpm/spmt_os2/config.m4 b/server/mpm/spmt_os2/config5.m4 similarity index 100% rename from server/mpm/spmt_os2/config.m4 rename to server/mpm/spmt_os2/config5.m4 diff --git a/server/mpm/threaded/config.m4 b/server/mpm/threaded/config5.m4 similarity index 86% rename from server/mpm/threaded/config.m4 rename to server/mpm/threaded/config5.m4 index 9702aa2c81..dbc00cbf72 100644 --- a/server/mpm/threaded/config.m4 +++ b/server/mpm/threaded/config5.m4 @@ -1,9 +1,5 @@ dnl ## XXX - Need a more thorough check of the proper flags to use if test "$MPM_NAME" = "threaded" ; then - APACHE_FAST_OUTPUT(server/mpm/$MPM_NAME/Makefile) - - APACHE_MPM_PTHREAD - fi -- 2.40.0