echo "configuring package in $1 now"
ac_popdir=`pwd`
ac_abs_srcdir=`(cd $srcdir/$1 && pwd)`
+ apache_config_subdirs="$1"
cd $1
changequote(, )dnl
# A "../" for each directory in /$config_subdirs.
- ac_dots=`echo $config_subdirs|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`
+ ac_dots=`echo $apache_config_subdirs|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`
changequote([, ])dnl
# Make the cache file name correct relative to the subdirectory.
dnl ## Preload our OS configuration
APR_PRELOAD
-dnl ## Run configure for packages Apache uses
-APACHE_RUN_SUBDIR_CONFIG_NOW(lib/apr)
-. ./lib/apr/APRVARS
-
dnl ## Check for programs
AC_PROG_AWK
APACHE_FAST_OUTPUT(Makefile ap/Makefile lib/Makefile main/Makefile)
APACHE_FAST_OUTPUT(modules/Makefile os/Makefile support/Makefile lib/pcre/Makefile)
+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.
+APACHE_RUN_SUBDIR_CONFIG_NOW(lib/apr)
+. ./lib/apr/APRVARS
+
APACHE_GEN_CONFIG_VARS
dnl There needs to be a .deps file in the top build directory.