Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-weightadjust
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
libvmod-weightadjust
Commits
ce567ab2
Commit
ce567ab2
authored
Mar 06, 2015
by
Lasse Karstensen
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14 from nigoroll/4.0
4.0: Fixes for #6 and #13
parents
958c8b24
44413857
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
9 deletions
+29
-9
Makefile.am
Makefile.am
+1
-1
README.rst
README.rst
+15
-4
autogen.sh
autogen.sh
+3
-1
configure.ac
configure.ac
+8
-3
vmod_example.vcc
src/vmod_example.vcc
+2
-0
No files found.
Makefile.am
View file @
ce567ab2
ACLOCAL_AMFLAGS
=
-I
m4
ACLOCAL_AMFLAGS
=
-I
m4
-I
${
LIBVARNISHAPI_DATAROOTDIR
}
/aclocal
SUBDIRS
=
src
SUBDIRS
=
src
...
...
README.rst
View file @
ce567ab2
...
@@ -51,14 +51,18 @@ using the ``varnishtest`` tool.
...
@@ -51,14 +51,18 @@ using the ``varnishtest`` tool.
Building requires the Varnish header files and uses pkg-config to find
Building requires the Varnish header files and uses pkg-config to find
the necessary paths.
the necessary paths.
If you have installed Varnish to a non-standard directory, you may need to
override PKG_CONFIG_PATH so configure can find varnishapi.pc.
Usage::
Usage::
./autogen.sh
./autogen.sh
./configure
./configure
If you have installed Varnish to a non-standard directory, call
``autogen.sh`` and ``configure`` with ``PKG_CONFIG_PATH`` pointing to
the appropriate path. For example, when varnishd configure was called
with ``--prefix=$PREFIX``, use
PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig
export PKG_CONFIG_PATH
Make targets:
Make targets:
...
@@ -68,7 +72,7 @@ Make targets:
...
@@ -68,7 +72,7 @@ Make targets:
* make distcheck - run check and prepare a tarball of the vmod.
* make distcheck - run check and prepare a tarball of the vmod.
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;
sub vcl_deliver {
sub vcl_deliver {
...
@@ -76,3 +80,10 @@ In your VCL you could then use this vmod along the following lines::
...
@@ -76,3 +80,10 @@ In your VCL you could then use this vmod along the following lines::
set resp.http.hello = example.hello("World");
set resp.http.hello = example.hello("World");
}
}
COMMON PROBLEMS
===============
* configure: error: Need varnish.m4 -- see README.rst
Check if ``PKG_CONFIG_PATH`` has been set correctly before calling
``autogen.sh`` and ``configure``
autogen.sh
View file @
ce567ab2
...
@@ -37,7 +37,9 @@ fi
...
@@ -37,7 +37,9 @@ fi
set
-ex
set
-ex
aclocal
-I
m4
# check for varnishapi.m4 in custom paths
dataroot
=
$(
pkg-config
--variable
=
datarootdir varnishapi
)
aclocal
-I
m4
-I
${
dataroot
}
/aclocal
$LIBTOOLIZE
--copy
--force
$LIBTOOLIZE
--copy
--force
autoheader
autoheader
automake
--add-missing
--copy
--foreign
automake
--add-missing
--copy
--foreign
...
...
configure.ac
View file @
ce567ab2
...
@@ -2,6 +2,7 @@ AC_PREREQ(2.59)
...
@@ -2,6 +2,7 @@ AC_PREREQ(2.59)
AC_COPYRIGHT([Copyright (c) 2011-2015 Varnish Software AS])
AC_COPYRIGHT([Copyright (c) 2011-2015 Varnish Software AS])
AC_INIT([libvmod-example], [trunk])
AC_INIT([libvmod-example], [trunk])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_MACRO_DIR([m4])
m4_ifndef([VARNISH_VMOD_INCLUDES], AC_MSG_ERROR([Need varnish.m4 -- see README.rst]))
AC_CONFIG_SRCDIR(src/vmod_example.vcc)
AC_CONFIG_SRCDIR(src/vmod_example.vcc)
AM_CONFIG_HEADER(config.h)
AM_CONFIG_HEADER(config.h)
...
@@ -33,17 +34,21 @@ AM_CONDITIONAL(HAVE_RST2MAN, [test "x$RST2MAN" != "xno"])
...
@@ -33,17 +34,21 @@ AM_CONDITIONAL(HAVE_RST2MAN, [test "x$RST2MAN" != "xno"])
AC_HEADER_STDC
AC_HEADER_STDC
AC_CHECK_HEADERS([sys/stdlib.h])
AC_CHECK_HEADERS([sys/stdlib.h])
PKG_CHECK_MODULES([libvarnishapi], [varnishapi])
PKG_CHECK_MODULES([libvarnishapi], [varnishapi])
PKG_CHECK_VAR([LIBVARNISHAPI_DATAROOTDIR], [varnishapi], [datarootdir])
PKG_CHECK_VAR([LIBVARNISHAPI_BINDIR], [varnishapi], [bindir])
PKG_CHECK_VAR([LIBVARNISHAPI_SBINDIR], [varnishapi], [sbindir])
AC_SUBST([LIBVARNISHAPI_DATAROOTDIR])
# Varnish include files tree
# Varnish include files tree
VARNISH_VMOD_INCLUDES
VARNISH_VMOD_INCLUDES
VARNISH_VMOD_DIR
VARNISH_VMOD_DIR
VARNISH_VMODTOOL
VARNISH_VMODTOOL
AC_PATH_PROG([VARNISHTEST], [varnishtest])
AC_PATH_PROG([VARNISHTEST], [varnishtest], [],
[$LIBVARNISHAPI_BINDIR:$LIBVARNISHAPI_SBINDIR:$PATH])
AC_PATH_PROG([VARNISHD], [varnishd], [],
AC_PATH_PROG([VARNISHD], [varnishd], [],
[$
PATH:$PATH:`pkg-config varnishapi --variable=sbindir`
])
[$
LIBVARNISHAPI_SBINDIR:$LIBVARNISHAPI_BINDIR:$PATH
])
AC_CONFIG_FILES([
AC_CONFIG_FILES([
Makefile
Makefile
...
...
src/vmod_example.vcc
View file @
ce567ab2
...
@@ -8,7 +8,9 @@ You can even have links and lists in here:
...
@@ -8,7 +8,9 @@ You can even have links and lists in here:
* https://github.com/varnish/libvmod-example/
* https://github.com/varnish/libvmod-example/
* https://www.varnish-cache.org/
* https://www.varnish-cache.org/
The init-function declared next does not have documentation.
$Init init_function
$Function STRING hello(STRING)
$Function STRING hello(STRING)
The different functions provided by the VMOD should also have their own
The different functions provided by the VMOD should also have their own
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment