Commit 9f685ae7 authored by Ryan Bloom's avatar Ryan Bloom
Browse files

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
parent f9f35765
Loading
Loading
Loading
Loading
+6 −12
Original line number Diff line number Diff line
@@ -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"
+3 −15
Original line number Diff line number Diff line
@@ -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 <pthread.h>])
])
+0 −1
Original line number Diff line number Diff line
@@ -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
+6 −0
Original line number Diff line number Diff line
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
Loading