summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac36
1 files changed, 35 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index df981ca..99d501f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,7 +18,7 @@
# permissions and limitations under the License.
AC_PREREQ(2.57)
-AC_INIT([mod_mime_xattr],[0.3],[mzzvzrkngge (at) 0pointer (dot) net])
+AC_INIT([mod_mime_xattr],[0.4],[mzzvzrkngge (at) 0pointer (dot) net])
AC_CONFIG_SRCDIR([src/mod_mime_xattr.c])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([foreign 1.9 -Wall])
@@ -77,6 +77,12 @@ if test "x$GCC" = "xyes" ; then
done
fi
+PKG_PROG_PKG_CONFIG
+
+PKG_CHECK_MODULES(APR, [ apr-1])
+CFLAGS="$APR_CFLAGS $CFLAGS"
+LIBS="$APR_LIBS $LIBS"
+
AC_ARG_WITH(apxs,
AS_HELP_STRING(--with-apxs=PATH,/path/to/apxs),
[ AC_PATH_PROGS(APXS, [apxs2 apxs], "notfound", "$withval:$PATH") ],
@@ -91,6 +97,34 @@ AC_ARG_WITH(apachectl,
[ AC_PATH_PROGS(APACHECTL, [apache2ctl apachectl], "notfound", "$withval:$PATH") ],
[ AC_PATH_PROGS(APACHECTL, [apache2ctl apachectl], "notfound", "/usr/local/apache/bin:/usr/local/bin:/usr/sbin:$PATH")])
+#
+# Checking that we have Apache version 2
+#
+
+# saving current CFLAGS
+CFLAGS_SAVED=$CFLAGS
+CFLAGS="$CFLAGS -I`${APXS} -q INCLUDEDIR`"
+
+AC_MSG_CHECKING([for Apache 2])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ #include <ap_release.h>
+]], [[
+ char *version = AP_SERVER_BASEREVISION;
+]])],[
+ APACHE_2="yes"
+],[
+ APACHE_2="no"
+])
+
+AC_MSG_RESULT($APACHE_2)
+
+if test "x$APACHE_2" = "xno" ; then
+ AC_MSG_ERROR([*** Sorry, you need apache 2 ***])
+fi
+
+# restoring CFLAGS
+CFLAGS=$CFLAGS_SAVED
+
# Check for libattr
AC_CHECK_LIB([attr], [getxattr],, [AC_MSG_ERROR([*** Sorry, you have to install libattr ***])])
AC_CHECK_HEADER([attr/xattr.h],, [AC_MSG_ERROR([*** Sorry, you have to install the libattr headers ***])])