Commit b18fdfb3 authored by Nils Goroll's avatar Nils Goroll

Inherit the prefix from Varnish and document installation directories

parent 252eca49
...@@ -71,6 +71,21 @@ Make targets: ...@@ -71,6 +71,21 @@ Make targets:
* make check - runs the unit tests in ``src/tests/*.vtc`` * make check - runs the unit tests in ``src/tests/*.vtc``
* make distcheck - run check and prepare a tarball of the vmod. * make distcheck - run check and prepare a tarball of the vmod.
Installation directories
------------------------
By default, the vmod ``configure`` script installs the built vmod in
the same directory as Varnish, determined via ``pkg-config(1)``. The
vmod installation directory can be overridden by passing the
``VMOD_DIR`` variable to ``configure``.
Other files like man-pages and documentation are installed in the
locations determined by ``configure``, which inherits its default
``--prefix`` setting from Varnish.
USAGE EXAMPLE
=============
In your VCL you could then use this vmod along the following lines:: In your VCL you could then use this vmod along the following lines::
import example; import example;
......
...@@ -53,6 +53,7 @@ AS_VAR_IF([$1], [""], [$5], [$4])dnl ...@@ -53,6 +53,7 @@ AS_VAR_IF([$1], [""], [$5], [$4])dnl
]) ])
PKG_CHECK_MODULES([libvarnishapi], [varnishapi]) PKG_CHECK_MODULES([libvarnishapi], [varnishapi])
PKG_CHECK_VAR([LIBVARNISHAPI_PREFIX], [varnishapi], [prefix])
PKG_CHECK_VAR([LIBVARNISHAPI_DATAROOTDIR], [varnishapi], [datarootdir]) PKG_CHECK_VAR([LIBVARNISHAPI_DATAROOTDIR], [varnishapi], [datarootdir])
PKG_CHECK_VAR([LIBVARNISHAPI_BINDIR], [varnishapi], [bindir]) PKG_CHECK_VAR([LIBVARNISHAPI_BINDIR], [varnishapi], [bindir])
PKG_CHECK_VAR([LIBVARNISHAPI_SBINDIR], [varnishapi], [sbindir]) PKG_CHECK_VAR([LIBVARNISHAPI_SBINDIR], [varnishapi], [sbindir])
...@@ -62,6 +63,9 @@ AC_SUBST([LIBVARNISHAPI_DATAROOTDIR]) ...@@ -62,6 +63,9 @@ AC_SUBST([LIBVARNISHAPI_DATAROOTDIR])
VARNISH_VMOD_INCLUDES VARNISH_VMOD_INCLUDES
VARNISH_VMOD_DIR VARNISH_VMOD_DIR
VARNISH_VMODTOOL VARNISH_VMODTOOL
# inherit the prefix from Varnish.
# acessing ac_ variable because AC_PREFIX_DEFAULT acts too early
ac_default_prefix=$LIBVARNISHAPI_PREFIX
AC_PATH_PROG([VARNISHTEST], [varnishtest], [], AC_PATH_PROG([VARNISHTEST], [varnishtest], [],
[$LIBVARNISHAPI_BINDIR:$LIBVARNISHAPI_SBINDIR:$PATH]) [$LIBVARNISHAPI_BINDIR:$LIBVARNISHAPI_SBINDIR:$PATH])
......
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