dnl Autoconf file for dworker AC_PREREQ(2.50) AC_INIT(server/dworker.c) AC_CONFIG_AUX_DIR(build) sinclude(build/apr_common.m4) sinclude(build/find_apr.m4) sinclude(build/find_apu.m4) AC_PREFIX_DEFAULT(/usr/local/dworker) dnl Get the layout here, so we can pass the required variables to apr APR_ENABLE_LAYOUT(DWORKER, []) dnl reparse the configure arguments. APR_PARSE_ARGUMENTS APR_CONFIG_NICE(config.nice) nl=' ' dnl Check that mkdir -p works APR_MKDIR_P_CHECK($top_srcdir/build/mkdir.sh) AC_SUBST(mkdir_p) AC_CANONICAL_SYSTEM orig_prefix="$prefix" echo $ac_n "${nl}Configuring Apache Portable Runtime library...${nl}" APR_FIND_APR("$srcdir/apr", "./apr", 1, 1) if test "$apr_found" = "no"; then AC_MSG_ERROR([APR not found. Please read the documentation.]) fi if test "$apr_found" = "reconfig"; then APR_SUBDIR_CONFIG(apr, [--prefix=$prefix --exec-prefix=$exec_prefix --libdir=$libdir --includedir=$includedir --bindir=$bindir --datadir=$datadir --with-installbuilddir=$installbuilddir], [--enable-layout=*|\'--enable-layout=*]) dnl We must be the first to build and the last to be cleaned DW_BUILD_SRCLIB_DIRS="apr $DW_BUILD_SRCLIB_DIRS" DW_CLEAN_SRCLIB_DIRS="$DW_CLEAN_SRCLIB_DIRS apr" fi APR_SETIFNULL(CC, `$apr_config --cc`) APR_SETIFNULL(CPP, `$apr_config --cpp`) APR_SETIFNULL(APR_LIBTOOL, `$apr_config --apr-libtool`) APR_ADDTO(CFLAGS, `$apr_config --cflags`) APR_ADDTO(CPPFLAGS, `$apr_config --cppflags`) APR_ADDTO(LDFLAGS, `$apr_config --ldflags`) SHLIBPATH_VAR=`$apr_config --shlib-path-var` APR_BINDIR=`$apr_config --bindir` APR_INCLUDEDIR=`$apr_config --includedir` APR_VERSION=`$apr_config --version` APR_CONFIG="$apr_config" AC_SUBST(APR_LIBTOOL) AC_SUBST(APR_BINDIR) AC_SUBST(APR_INCLUDEDIR) AC_SUBST(APR_VERSION) AC_SUBST(APR_CONFIG) echo $ac_n "${nl}Configuring Apache Portable Runtime Utility library...${nl}" APR_FIND_APU("$srcdir/apr-util", "./apr-util", 1, 1) if test "$apu_found" = "no"; then AC_MSG_ERROR([APR-util not found. Please read the documentation.]) fi # Catch some misconfigurations: case ${apr_found}.${apu_found} in reconfig.yes) AC_MSG_ERROR([Cannot use an external APR-util with the bundled APR]) ;; yes.reconfig) AC_MSG_ERROR([Cannot use an external APR with the bundled APR-util]) ;; esac if test "$apu_found" = "reconfig"; then APR_SUBDIR_CONFIG(apr-util, [--with-apr=../apr --prefix=$prefix --exec-prefix=$exec_prefix --libdir=$libdir --includedir=$includedir --bindir=$bindir], [--enable-layout=*|\'--enable-layout=*]) dnl We must be the last to build and the first to be cleaned DW_BUILD_SRCLIB_DIRS="$DW_BUILD_SRCLIB_DIRS apr-util" DW_CLEAN_SRCLIB_DIRS="apr-util $DW_CLEAN_SRCLIB_DIRS" fi APR_ADDTO(LDFLAGS, `$apu_config --ldflags`) APU_BINDIR=`$apu_config --bindir` APU_INCLUDEDIR=`$apu_config --includedir` APU_VERSION=`$apu_config --version` APU_CONFIG="$APU_BINDIR/apu-`echo ${APU_VERSION} | sed 's,\..*,,'`-config" AC_SUBST(APU_BINDIR) AC_SUBST(APU_INCLUDEDIR) AC_SUBST(APU_VERSION) AC_SUBST(APU_CONFIG) AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL echo $ac_n "${nl}Configuring dworker...${nl}" dnl Absolute source/build directory abs_srcdir=`(cd $srcdir && pwd)` abs_builddir=`pwd` dnl get our version information get_version="$abs_srcdir/build/get-version.sh" version_hdr="$abs_srcdir/include/dw_version.h" DW_MAJOR_VERSION="`$get_version major $version_hdr DW`" DW_DOTTED_VERSION="`$get_version all $version_hdr DW`" APR_ADDTO(CFLAGS, [-g]) APR_ADDTO(CFLAGS, [-Wall]) APR_ADDTO(CFLAGS, [-Werror]) AC_SUBST(DW_MAJOR_VERSION) AC_SUBST(DW_DOTTED_VERSION) AC_SUBST(DW_BUILD_SRCLIB_DIRS) AC_SUBST(DW_CLEAN_SRCLIB_DIRS) libs="`$apu_config --link-libtool --libs` `$apr_config --link-libtool --libs`" APR_ADDTO(DW_LIBS, [$libs]) AC_SUBST(DW_LIBS) AC_CONFIG_FILES([Makefile]) AC_OUTPUT