Commit 811f0680 authored by Martin Blix Grydeland's avatar Martin Blix Grydeland

Use pkg-config to discover vmoddir

parent 3ca063c8
...@@ -8,5 +8,7 @@ compile your vmod. Both the VARNISHSRCDIR and VARNISHSRCDIR/include ...@@ -8,5 +8,7 @@ compile your vmod. Both the VARNISHSRCDIR and VARNISHSRCDIR/include
will be added to the include search paths for your module. will be added to the include search paths for your module.
Optionally you can also set the vmod install dir by adding VMODDIR=DIR Optionally you can also set the vmod install dir by adding VMODDIR=DIR
(defaults to LIBDIR/varnish/vmods, which would become (defaults to the pkg-config discovered directory from your Varnish
/usr/local/lib/varnish/vmods on most platforms). installation).
AC_PREREQ(2.59) AC_PREREQ(2.59)
AC_COPYRIGHT([Copyright (c) 2011 Varnish Software AS]) AC_COPYRIGHT([Copyright (c) 2011 Varnish Software AS])
AC_INIT([libvmod_example], [0.1]) AC_INIT([libvmod-example], [0.1])
AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR(src/vmod.vcc) AC_CONFIG_SRCDIR(src/vmod.vcc)
AM_CONFIG_HEADER(config.h) AM_CONFIG_HEADER(config.h)
...@@ -22,6 +22,9 @@ AC_PROG_INSTALL ...@@ -22,6 +22,9 @@ AC_PROG_INSTALL
AC_PROG_LIBTOOL AC_PROG_LIBTOOL
AC_PROG_MAKE_SET AC_PROG_MAKE_SET
# Check for pkg-config
PKG_PROG_PKG_CONFIG
# Checks for header files. # Checks for header files.
AC_HEADER_STDC AC_HEADER_STDC
AC_CHECK_HEADERS([sys/stdlib.h]) AC_CHECK_HEADERS([sys/stdlib.h])
...@@ -43,7 +46,10 @@ AC_CHECK_FILE([$VARNISHSRC/include/varnishapi.h], ...@@ -43,7 +46,10 @@ AC_CHECK_FILE([$VARNISHSRC/include/varnishapi.h],
# vmod installation dir # vmod installation dir
AC_ARG_VAR([VMODDIR], [vmod installation directory @<:@LIBDIR/varnish/vmods@:>@]) AC_ARG_VAR([VMODDIR], [vmod installation directory @<:@LIBDIR/varnish/vmods@:>@])
if test "x$VMODDIR" = x; then if test "x$VMODDIR" = x; then
VMODDIR=$libdir/varnish/vmods VMODDIR=`pkg-config --variable=vmoddir varnishapi`
if test "x$VMODDIR" = x; then
AC_MSG_FAILURE([Can't determine vmod installation directory])
fi
fi fi
AC_CONFIG_FILES([ AC_CONFIG_FILES([
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment