Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
77 lines (64 sloc) 1.93 KB
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.68])
AC_INIT([mod_cutest], [0.0.1], [oasynnoum@gmail.com])
AC_CONFIG_SRCDIR([ModCuTest.h])
AC_DEFUN([AC_PROG_APXS], [
AC_CHECK_PROG([HAVE_APXS], [apxs], [yes], [no])
if test "$HAVE_APXS" = "yes"; then
APXS="apxs"
else
AC_CHECK_PROG([HAVE_APXS2], [apxs2], [yes], [no])
if test "$HAVE_APXS2" = "yes"; then
APXS="apxs2"
else
AC_MSG_ERROR([apxs is NOT found.])
fi
fi
AC_SUBST([APXS])
])
AC_DEFUN([AC_PROG_APACHCTL], [
AC_CHECK_PROG([HAVE_APACHECTL], [apachectl], [yes], [no])
if test "$HAVE_APACHECTL" = "yes"; then
APACHECTL="apachectl"
else
AC_MSG_ERROR([apachectl is NOT found.])
fi
AC_SUBST([APACHECTL])
])
# Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_APXS
AC_PROG_APACHCTL
INSTALLBUILDDIR=`$APXS -q installbuilddir`
MODCUTEST_INCLUDEDIR=`$APXS -q includedir`
MODCUTEST_BINDIR=`$APXS -q bindir`
MODCUTEST_LIBEXECDIR=`$APXS -q libexecdir`
AC_SUBST([MODCUTEST_INCLUDEDIR])
AC_SUBST([MODCUTEST_BINDIR])
AC_SUBST([MODCUTEST_LIBEXECDIR])
rm -rf ./build
cp -R ${INSTALLBUILDDIR} ./
INSTALLBUILDDIR=`$APXS -q installbuilddir`
TOP_BUILDDIR="${INSTALLBUILDDIR}/../"
TOP_SRCDIR=$TOP_BUILDDIR
body="top_srcdir=$TOP_SRCDIR
top_builddir=$TOP_BUILDDIR
APXS=$APXS
APACHECTL=$APACHECTL
modcutest_includedir=`$APXS -q includedir`
modcutest_libexecdir=`$APXS -q libexecdir`
modcutest_bindir=`$APXS -q bindir`"
echo "$body" > definition.mk
# Checks for libraries.
# FIXME: Replace `main' with a function in `-lapreq2':
AC_CHECK_LIB([apreq2], [main])
# Checks for header files.
AC_CHECK_HEADERS([limits.h stdlib.h string.h])
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS([memmove memset realpath])
AC_OUTPUT