acinclude.m4 revision 4cbb3bcf66a6788196bcc7244e4e36705acfbb57
230N/A
230N/Adnl APACHE_SUBST(VARIABLE)
230N/Adnl Makes VARIABLE available in generated files
230N/Adnl (do not use @variable@ in Makefiles, but $(variable))
230N/AAC_DEFUN(APACHE_SUBST,[
230N/A APACHE_VAR_SUBST="$APACHE_VAR_SUBST $1"
230N/A AC_SUBST($1)
230N/A])
230N/A
230N/Adnl APACHE_FAST_OUTPUT(FILENAME)
230N/Adnl Perform substitutions on FILENAME (Makefiles only)
230N/AAC_DEFUN(APACHE_FAST_OUTPUT,[
230N/A APACHE_FAST_OUTPUT_FILES="$APACHE_FAST_OUTPUT_FILES $1"
230N/A])
230N/A
230N/Adnl APACHE_MKDIR_P_CHECK
230N/Adnl checks whether mkdir -p works
230N/AAC_DEFUN(APACHE_MKDIR_P_CHECK,[
230N/A AC_CACHE_CHECK(for working mkdir -p, ac_cv_mkdir_p,[
230N/A test -d conftestdir && rm -rf conftestdir
230N/A mkdir -p conftestdir/somedir >/dev/null 2>&1
5680N/A if test -d conftestdir/somedir; then
230N/A ac_cv_mkdir_p=yes
5680N/A else
230N/A ac_cv_mkdir_p=no
230N/A fi
230N/A rm -rf conftestdir
5184N/A ])
844N/A])
5184N/A
230N/Adnl APACHE_GEN_CONFIG_VARS
5184N/Adnl Creates config_vars.mk
618N/AAC_DEFUN(APACHE_GEN_CONFIG_VARS,[
1258N/A APACHE_SUBST(abs_srcdir)
230N/A APACHE_SUBST(bindir)
5184N/A APACHE_SUBST(sbindir)
2899N/A APACHE_SUBST(cgidir)
5680N/A APACHE_SUBST(logfiledir)
230N/A APACHE_SUBST(exec_prefix)
230N/A APACHE_SUBST(datadir)
230N/A APACHE_SUBST(localstatedir)
230N/A APACHE_SUBST(mandir)
230N/A APACHE_SUBST(libexecdir)
230N/A APACHE_SUBST(htdocsdir)
230N/A APACHE_SUBST(includedir)
230N/A APACHE_SUBST(iconsdir)
230N/A APACHE_SUBST(sysconfdir)
230N/A APACHE_SUBST(installbuilddir)
230N/A APACHE_SUBST(other_targets)
230N/A APACHE_SUBST(progname)
230N/A APACHE_SUBST(prefix)
230N/A APACHE_SUBST(AWK)
230N/A APACHE_SUBST(CC)
230N/A APACHE_SUBST(CPP)
230N/A APACHE_SUBST(CXX)
230N/A APACHE_SUBST(CPPFLAGS)
230N/A APACHE_SUBST(CFLAGS)
230N/A APACHE_SUBST(CXXFLAGS)
230N/A APACHE_SUBST(LTFLAGS)
230N/A APACHE_SUBST(LDFLAGS)
230N/A APACHE_SUBST(LT_LDFLAGS)
7292N/A APACHE_SUBST(SH_LDFLAGS)
230N/A APACHE_SUBST(HTTPD_LDFLAGS)
6479N/A APACHE_SUBST(LIBS)
230N/A APACHE_SUBST(DEFS)
230N/A APACHE_SUBST(INCLUDES)
230N/A APACHE_SUBST(NOTEST_CPPFLAGS)
230N/A APACHE_SUBST(NOTEST_CFLAGS)
230N/A APACHE_SUBST(NOTEST_CXXFLAGS)
230N/A APACHE_SUBST(NOTEST_LDFLAGS)
230N/A APACHE_SUBST(NOTEST_LIBS)
230N/A APACHE_SUBST(EXTRA_CPPFLAGS)
230N/A APACHE_SUBST(EXTRA_CFLAGS)
230N/A APACHE_SUBST(EXTRA_CXXFLAGS)
230N/A APACHE_SUBST(EXTRA_LDFLAGS)
230N/A APACHE_SUBST(EXTRA_LIBS)
5680N/A APACHE_SUBST(EXTRA_INCLUDES)
230N/A APACHE_SUBST(LIBTOOL)
230N/A APACHE_SUBST(SHELL)
230N/A APACHE_SUBST(MODULE_DIRS)
230N/A APACHE_SUBST(MODULE_CLEANDIRS)
230N/A APACHE_SUBST(PORT)
230N/A APACHE_SUBST(CORE_IMPLIB_FILE)
230N/A APACHE_SUBST(CORE_IMPLIB)
230N/A APACHE_SUBST(SH_LIBTOOL)
230N/A APACHE_SUBST(MK_IMPLIB)
230N/A APACHE_SUBST(INSTALL_PROG_FLAGS)
230N/A
230N/A abs_srcdir="`(cd $srcdir && pwd)`"
230N/A
230N/A APACHE_MKDIR_P_CHECK
230N/A echo creating config_vars.mk
230N/A > config_vars.mk
230N/A for i in $APACHE_VAR_SUBST; do
230N/A eval echo "$i = \$$i" >> config_vars.mk
230N/A done
230N/A])
230N/A
230N/Adnl APACHE_GEN_MAKEFILES
4547N/Adnl Creates Makefiles
4547N/AAC_DEFUN(APACHE_GEN_MAKEFILES,[
4547N/A $SHELL $srcdir/build/fastgen.sh $srcdir $ac_cv_mkdir_p $BSD_MAKEFILE $APACHE_FAST_OUTPUT_FILES
4547N/A])
5184N/A
7292N/Adnl ## APACHE_OUTPUT(file)
7292N/Adnl ## adds "file" to the list of files generated by AC_OUTPUT
7292N/Adnl ## This macro can be used several times.
5184N/AAC_DEFUN(APACHE_OUTPUT, [
5184N/A APACHE_OUTPUT_FILES="$APACHE_OUTPUT_FILES $1"
230N/A])
230N/A
230N/Adnl
3817N/Adnl APACHE_TYPE_RLIM_T
3817N/Adnl
3817N/Adnl If rlim_t is not defined, define it to int
3817N/Adnl
7292N/AAC_DEFUN(APACHE_TYPE_RLIM_T, [
7292N/A AC_CACHE_CHECK([for rlim_t], ac_cv_type_rlim_t, [
AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
], [rlim_t spoon;], [
ac_cv_type_rlim_t=yes
],[ac_cv_type_rlim_t=no
])
])
if test "$ac_cv_type_rlim_t" = "no" ; then
AC_DEFINE(rlim_t, int,
[Define to 'int' if <sys/resource.h> doesn't define it for us])
fi
])
dnl APACHE_MODPATH_INIT(modpath)
AC_DEFUN(APACHE_MODPATH_INIT,[
current_dir=$1
modpath_current=modules/$1
modpath_static=
modpath_shared=
test -d $1 || $srcdir/build/mkdir.sh $modpath_current
> $modpath_current/modules.mk
])dnl
dnl
AC_DEFUN(APACHE_MODPATH_FINISH,[
echo "DISTCLEAN_TARGETS = modules.mk" >> $modpath_current/modules.mk
echo "static = $modpath_static" >> $modpath_current/modules.mk
echo "shared = $modpath_shared" >> $modpath_current/modules.mk
if test ! -z "$modpath_static" -o ! -z "$modpath_shared"; then
MODULE_DIRS="$MODULE_DIRS $current_dir"
else
MODULE_CLEANDIRS="$MODULE_CLEANDIRS $current_dir"
fi
APACHE_FAST_OUTPUT($modpath_current/Makefile)
])dnl
dnl
dnl APACHE_MODPATH_ADD(name[, shared[, objects [, ldflags[, libs]]]])
AC_DEFUN(APACHE_MODPATH_ADD,[
if test -z "$3"; then
objects="mod_$1.lo"
else
objects="$3"
fi
if test -z "$module_standalone"; then
if test -z "$2"; then
libname="mod_$1.la"
BUILTIN_LIBS="$BUILTIN_LIBS $modpath_current/$libname"
modpath_static="$modpath_static $libname"
cat >>$modpath_current/modules.mk<<EOF
$libname: $objects
\$(MOD_LINK) $objects
EOF
else
apache_need_shared=yes
libname="mod_$1.la"
shobjects=`echo $objects | sed 's/\.lo/.slo/g'`
modpath_shared="$modpath_shared $libname"
cat >>$modpath_current/modules.mk<<EOF
$libname: $shobjects
\$(SH_LINK) -rpath \$(libexecdir) -module -avoid-version $4 $objects $5
EOF
fi
fi
])dnl
dnl
dnl APACHE_MODULE(name, helptext[, objects[, structname[, default[, config]]]])
dnl
dnl default is one of:
dnl yes -- enabled by default. user must explicitly disable.
dnl no -- disabled under default, most, all. user must explicitly enable.
dnl most -- disabled by default. enabled explicitly or with most or all.
dnl "" -- disabled under default, most. enabled explicitly or with all.
dnl
dnl basically: yes/no is a hard setting. "most" means follow the "most"
dnl setting. otherwise, fall under the "all" setting.
dnl explicit yes/no always overrides.
dnl
AC_DEFUN(APACHE_MODULE,[
AC_MSG_CHECKING(whether to enable mod_$1)
define([optname],[ --]ifelse($5,yes,disable,enable)[-]translit($1,_,-))dnl
AC_ARG_ENABLE(translit($1,_,-),optname() substr([ ],len(optname()))$2,,enable_$1=ifelse($5,,maybe-all,$5))
undefine([optname])dnl
_apmod_extra_msg=""
if test "$enable_$1" = "most"; then
if test "$module_selection" = "most" -o "$module_selection" = "all"; then
enable_$1=$module_default
_apmod_extra_msg=" ($module_selection)"
else
enable_$1=no
fi
elif test "$enable_$1" = "maybe-all"; then
if test "$module_selection" = "all"; then
enable_$1=$module_default
_apmod_extra_msg=" (all)"
else
enable_$1=no
fi
fi
AC_MSG_RESULT($enable_$1$_apmod_extra_msg)
if test "$enable_$1" != "no"; then
case "$enable_$1" in
shared*)
enable_$1=`echo $ac_n $enable_$1$ac_c|sed 's/shared,*//'`
sharedobjs=yes
shared=yes;;
*)
MODLIST="$MODLIST ifelse($4,,$1,$4)"
if test "$1" = "so"; then
sharedobjs=yes
fi
shared="";;
esac
ifelse([$6],,:,[$6])
APACHE_MODPATH_ADD($1, $shared, $3)
fi
])dnl
dnl
dnl APACHE_LAYOUT(configlayout, layoutname)
AC_DEFUN(APACHE_LAYOUT,[
if test ! -f $srcdir/config.layout; then
echo "** Error: Layout file $srcdir/config.layout not found"
echo "** Error: Cannot use undefined layout '$LAYOUT'"
exit 1
fi
pldconf=./config.pld
changequote({,})
sed -e "1,/[ ]*<[lL]ayout[ ]*$2[ ]*>[ ]*/d" \
-e '/[ ]*<\/Layout>[ ]*/,$d' \
-e "s/^[ ]*//g" \
-e "s/:[ ]*/=\'/g" \
-e "s/[ ]*$/'/g" \
$1 > $pldconf
layout_name=$2
. $pldconf
rm $pldconf
for var in prefix exec_prefix bindir sbindir libexecdir mandir \
sysconfdir datadir iconsdir htdocsdir cgidir includedir \
localstatedir runtimedir logfiledir proxycachedir installbuilddir; do
eval "val=\"\$$var\""
case $val in
*+)
val=`echo $val | sed -e 's;\+$;;'`
eval "$var=\"\$val\""
autosuffix=yes
;;
*)
autosuffix=no
;;
esac
val=`echo $val | sed -e 's:\(.\)/*$:\1:'`
val=`echo $val | sed -e 's:$\([a-z_]*\):$(\1):g'`
if test "$autosuffix" = "yes"; then
if echo $val | grep apache >/dev/null; then
addtarget=no
else
addtarget=yes
fi
if test "$addtarget" = "yes"; then
val="$val/apache"
fi
fi
eval "$var='$val'"
done
changequote([,])
])dnl
dnl
dnl APACHE_ENABLE_LAYOUT
dnl
AC_DEFUN(APACHE_ENABLE_LAYOUT,[
AC_ARG_ENABLE(layout,
[ --enable-layout=LAYOUT],[
LAYOUT=$enableval
])
if test -z "$LAYOUT"; then
# XXX FIXME: this isn't a complete list of things that have to be set to
# create the Apache layout in config.layout, and it really should just
# use what is specified in config.layout instead of duping it.
htdocsdir='$(prefix)/htdocs'
iconsdir='$(prefix)/icons'
cgidir='$(prefix)/cgi-bin'
logfiledir='$(prefix)/logs'
sysconfdir='${prefix}/conf'
libexecdir='${prefix}/modules'
mandir='${prefix}/man'
layout_name=Apache
installbuilddir='${prefix}/build'
else
APACHE_LAYOUT($srcdir/config.layout, $LAYOUT)
fi
AC_MSG_CHECKING(for chosen layout)
AC_MSG_RESULT($layout_name)
])
dnl
dnl APACHE_ENABLE_MODULES
dnl
AC_DEFUN(APACHE_ENABLE_MODULES,[
module_selection=default
module_default=yes
AC_ARG_ENABLE(modules,
[ --enable-modules=MODULE-LIST],[
for i in $enableval; do
if test "$i" = "all" -o "$i" = "most"; then
module_selection=$i
else
eval "enable_$i=yes"
fi
done
])
AC_ARG_ENABLE(mods-shared,
[ --enable-mods-shared=MODULE-LIST],[
for i in $enableval; do
if test "$i" = "all" -o "$i" = "most"; then
module_selection=$i
module_default=shared
else
i=`echo $i | sed 's/-/_/g'`
eval "enable_$i=shared"
fi
done
])
])
AC_DEFUN(APACHE_REQUIRE_CXX,[
if test -z "$apache_cxx_done"; then
AC_PROG_CXX
AC_PROG_CXXCPP
apache_cxx_done=yes
fi
])
dnl
dnl APACHE_CHECK_SSL_TOOLKIT
dnl
dnl Find the openssl toolkit installation and check it for the right
dnl version, then add its flags to INCLUDES and LIBS. This should
dnl really be using a custom AC_TRY_COMPILE function to test the includes
dnl and then AC_TRY_LINK to test the libraries directly for the version,
dnl but that will require someone who knows how to program openssl.
dnl
AC_DEFUN(APACHE_CHECK_SSL_TOOLKIT,[
if test "x$ap_ssltk_base" = "x"; then
AC_MSG_CHECKING(for SSL/TLS toolkit base)
ap_ssltk_base=""
AC_ARG_WITH(ssl, [ --with-ssl[=DIR] SSL/TLS toolkit (OpenSSL)], [
if test "x$withval" != "xyes" -a "x$withval" != "x"; then
ap_ssltk_base="$withval"
fi
])
if test "x$ap_ssltk_base" = "x"; then
AC_CACHE_VAL(ap_cv_ssltk,[
#
# shotgun approach: find all occurrences of the openssl program
#
ap_ssltk_try=""
for p in /usr/local/openssl/bin /usr/local/ssl/bin $path; do
if test -f "$p/openssl"; then
ap_ssltk_try="$ap_ssltk_try $p"
fi
done
if test "x$ap_ssltk_try" = "x"; then
AC_MSG_ERROR(['openssl' not found in path])
fi
for p in $ap_ssltk_try; do
ap_ssltk_version="`$p/openssl version`"
case "$ap_ssltk_version" in
"OpenSSL "[[1-9]]* | \
"OpenSSL "0.9.[[6-9]]* | \
"OpenSSL "0.[[1-9]][[0-9]]* )
ap_cv_ssltk="`(cd $p/.. && pwd)`"
break
;;
*)
# skip because it is too old or a bad result
;;
esac
done
if test "x$ap_cv_ssltk" = "x"; then
AC_MSG_ERROR([requires OpenSSL 0.9.6 or higher])
fi
])
ap_ssltk_base="$ap_cv_ssltk"
fi
if test ! -d $ap_ssltk_base; then
AC_MSG_ERROR([invalid SSL/TLS toolkit base directory $ap_ssltk_base])
fi
AC_MSG_RESULT($ap_ssltk_base)
AC_MSG_CHECKING(for SSL/TLS toolkit version)
AC_MSG_RESULT($ap_ssltk_version)
AC_MSG_CHECKING(for SSL/TLS toolkit includes)
ap_ssltk_incdir=""
for p in $ap_ssltk_base/include /usr/local/openssl/include \
/usr/local/ssl/include /usr/local/include /usr/include; do
if test -f "$p/openssl/ssl.h"; then
ap_ssltk_incdir="$p"
break
fi
done
if test "x$ap_ssltk_incdir" = "x"; then
AC_MSG_ERROR([OpenSSL headers not found])
fi
AC_MSG_RESULT($ap_ssltk_incdir)
AC_MSG_CHECKING(for SSL/TLS toolkit libraries)
ap_ssltk_libdir=""
for p in $ap_ssltk_base/lib /usr/local/openssl/lib \
/usr/local/ssl/lib /usr/local/lib /usr/lib /lib; do
if test -f "$p/libssl.a" -o -f "$p/libssl.so"; then
ap_ssltk_libdir="$p"
break
fi
done
if test ".$ap_ssltk_libdir" = .; then
AC_MSG_ERROR([OpenSSL libraries not found])
fi
AC_MSG_RESULT($ap_ssltk_libdir)
dnl # annotate the Apache build environment with determined information
if test "x$ap_ssltk_incdir" != "x/usr/include"; then
APR_ADDTO(INCLUDES, [-I$ap_ssltk_incdir])
fi
if test "x$ap_ssltk_libdir" != "x/usr/lib"; then
APR_ADDTO(LIBS, [-L$ap_ssltk_libdir])
if test "x$ap_platform_runtime_link_flag" != "x"; then
APR_ADDTO(LIBS, [$ap_platform_runtime_link_flag$ap_ssltk_libdir])
fi
fi
APR_ADDTO(LIBS, [-lssl -lcrypto])
ap_cv_ssltk="$ap_ssltk_base"
fi
])