Commit c2259e0a authored by Nils Goroll's avatar Nils Goroll

initial vcdk skeleton

parents
# build system
.deps/
.libs/
autom4te.cache/
build-aux/
m4/
*.la
*.lo
*.o
*.tar.gz
Makefile
Makefile.in
aclocal.m4
config.h
config.h.in
config.log
config.status
configure
libtool
stamp-h1
# test suite
*.log
*.trs
# vmodtool
vcc_*_if.[ch]
vmod_*.rst
# man
*.1
*_options.rst
*_synopsis.rst
vmod_*.3
ACLOCAL_AMFLAGS = -I m4 -I @VARNISHAPI_DATAROOTDIR@/aclocal
DISTCHECK_CONFIGURE_FLAGS = RST2MAN=:
SUBDIRS = src
#!/bin/sh
set -e
set -u
WORK_DIR=$(pwd)
ROOT_DIR=$(dirname "$0")
cd "$ROOT_DIR"
if ! command -v libtoolize >/dev/null
then
echo "libtoolize: command not found, falling back to glibtoolize" >&2
alias libtoolize=glibtoolize
fi
mkdir -p m4
aclocal
libtoolize --copy --force
autoheader
automake --add-missing --copy --foreign
autoconf
cd "$WORK_DIR"
"$ROOT_DIR"/configure "$@"
AC_PREREQ([2.68])
AC_INIT([varnish-objvar], [0.1])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE([1.12 -Wall -Werror foreign parallel-tests])
AM_SILENT_RULES([yes])
AM_PROG_AR
LT_PREREQ([2.2.6])
LT_INIT([dlopen disable-static])
AC_ARG_WITH([rst2man],
AS_HELP_STRING(
[--with-rst2man=PATH],
[Location of rst2man (auto)]),
[RST2MAN="$withval"],
AC_CHECK_PROGS(RST2MAN, [rst2man rst2man.py], []))
VARNISH_PREREQ([5.2.0])
VARNISH_VMODS([constant globalvar taskvar topvar])
AC_CONFIG_FILES([
Makefile
src/Makefile
])
AC_OUTPUT
AS_ECHO("
==== $PACKAGE_STRING ====
varnish: $VARNISH_VERSION
prefix: $prefix
vmoddir: $vmoddir
vcldir: $vcldir
pkgvcldir: $pkgvcldir
compiler: $CC
cflags: $CFLAGS
ldflags: $LDFLAGS
")
AM_CFLAGS = $(VARNISHAPI_CFLAGS)
# Modules
vmod_LTLIBRARIES = \
libvmod_constant.la \
libvmod_globalvar.la \
libvmod_taskvar.la \
libvmod_topvar.la
libvmod_constant_la_LDFLAGS = $(VMOD_LDFLAGS)
libvmod_constant_la_SOURCES = vmod_constant.c
nodist_libvmod_constant_la_SOURCES = \
vcc_constant_if.c \
vcc_constant_if.h
libvmod_globalvar_la_LDFLAGS = $(VMOD_LDFLAGS)
libvmod_globalvar_la_SOURCES = vmod_globalvar.c
nodist_libvmod_globalvar_la_SOURCES = \
vcc_globalvar_if.c \
vcc_globalvar_if.h
libvmod_taskvar_la_LDFLAGS = $(VMOD_LDFLAGS)
libvmod_taskvar_la_SOURCES = vmod_taskvar.c
nodist_libvmod_taskvar_la_SOURCES = \
vcc_taskvar_if.c \
vcc_taskvar_if.h
libvmod_topvar_la_LDFLAGS = $(VMOD_LDFLAGS)
libvmod_topvar_la_SOURCES = vmod_topvar.c
nodist_libvmod_topvar_la_SOURCES = \
vcc_topvar_if.c \
vcc_topvar_if.h
@BUILD_VMOD_CONSTANT@
@BUILD_VMOD_GLOBALVAR@
@BUILD_VMOD_TASKVAR@
@BUILD_VMOD_TOPVAR@
# Test suite
AM_TESTS_ENVIRONMENT = \
PATH="$(abs_builddir):$(VARNISH_TEST_PATH):$(PATH)" \
LD_LIBRARY_PATH="$(VARNISH_LIBRARY_PATH)"
TEST_EXTENSIONS = .vtc
VTC_LOG_COMPILER = varnishtest -v
AM_VTC_LOG_FLAGS = \
-p vcl_path="$(abs_top_srcdir)/vcl" \
-p vmod_path="$(abs_builddir)/.libs:$(vmoddir)"
TESTS = \
vtc/vmod_constant.vtc \
vtc/vmod_globalvar.vtc \
vtc/vmod_taskvar.vtc \
vtc/vmod_topvar.vtc
# Documentation
dist_doc_DATA = \
vmod_constant.vcc \
vmod_globalvar.vcc \
vmod_taskvar.vcc \
vmod_topvar.vcc \
$(TESTS)
dist_man_MANS = \
vmod_constant.3 \
vmod_globalvar.3 \
vmod_taskvar.3 \
vmod_topvar.3
.rst.1:
$(AM_V_GEN) $(RST2MAN) $< $@
#include "config.h"
#include <cache/cache.h>
#include <vdef.h>
#include <vrt.h>
#include <vcl.h>
#include "vcc_constant_if.h"
VCL_STRING __match_proto__(td_constant_hello)
vmod_hello(VRT_CTX)
{
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
return ("vmod-constant");
}
$Module constant 3 Varnish constant Module
DESCRIPTION
===========
This VCC file was generated by VCDK, it is used to for both the VMOD
interface and its manual using reStructuredText.
XXX: document vmod-constant
Example
::
import constant;
sub vcl_deliver {
set resp.http.Hello = constant.hello();
}
XXX: define vmod-constant interface
$Function STRING hello()
Description
Hello world for vmod-constant
SEE ALSO
========vcl\(7),varnishd\(1)
#include "config.h"
#include <cache/cache.h>
#include <vdef.h>
#include <vrt.h>
#include <vcl.h>
#include "vcc_globalvar_if.h"
VCL_STRING __match_proto__(td_globalvar_hello)
vmod_hello(VRT_CTX)
{
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
return ("vmod-globalvar");
}
$Module globalvar 3 Varnish globalvar Module
DESCRIPTION
===========
This VCC file was generated by VCDK, it is used to for both the VMOD
interface and its manual using reStructuredText.
XXX: document vmod-globalvar
Example
::
import globalvar;
sub vcl_deliver {
set resp.http.Hello = globalvar.hello();
}
XXX: define vmod-globalvar interface
$Function STRING hello()
Description
Hello world for vmod-globalvar
SEE ALSO
========vcl\(7),varnishd\(1)
#include "config.h"
#include <cache/cache.h>
#include <vdef.h>
#include <vrt.h>
#include <vcl.h>
#include "vcc_taskvar_if.h"
VCL_STRING __match_proto__(td_taskvar_hello)
vmod_hello(VRT_CTX)
{
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
return ("vmod-taskvar");
}
$Module taskvar 3 Varnish taskvar Module
DESCRIPTION
===========
This VCC file was generated by VCDK, it is used to for both the VMOD
interface and its manual using reStructuredText.
XXX: document vmod-taskvar
Example
::
import taskvar;
sub vcl_deliver {
set resp.http.Hello = taskvar.hello();
}
XXX: define vmod-taskvar interface
$Function STRING hello()
Description
Hello world for vmod-taskvar
SEE ALSO
========vcl\(7),varnishd\(1)
#include "config.h"
#include <cache/cache.h>
#include <vdef.h>
#include <vrt.h>
#include <vcl.h>
#include "vcc_topvar_if.h"
VCL_STRING __match_proto__(td_topvar_hello)
vmod_hello(VRT_CTX)
{
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
return ("vmod-topvar");
}
$Module topvar 3 Varnish topvar Module
DESCRIPTION
===========
This VCC file was generated by VCDK, it is used to for both the VMOD
interface and its manual using reStructuredText.
XXX: document vmod-topvar
Example
::
import topvar;
sub vcl_deliver {
set resp.http.Hello = topvar.hello();
}
XXX: define vmod-topvar interface
$Function STRING hello()
Description
Hello world for vmod-topvar
SEE ALSO
========vcl\(7),varnishd\(1)
varnishtest "test vmod-constant"
server s1 {
rxreq
txresp
} -start
varnish v1 -vcl+backend {
import constant;
sub vcl_deliver {
set resp.http.Hello = constant.hello();
}
} -start
client c1 {
txreq
rxresp
expect resp.status == 200
expect resp.http.Hello == "vmod-constant"
} -run
varnishtest "test vmod-globalvar"
server s1 {
rxreq
txresp
} -start
varnish v1 -vcl+backend {
import globalvar;
sub vcl_deliver {
set resp.http.Hello = globalvar.hello();
}
} -start
client c1 {
txreq
rxresp
expect resp.status == 200
expect resp.http.Hello == "vmod-globalvar"
} -run
varnishtest "test vmod-taskvar"
server s1 {
rxreq
txresp
} -start
varnish v1 -vcl+backend {
import taskvar;
sub vcl_deliver {
set resp.http.Hello = taskvar.hello();
}
} -start
client c1 {
txreq
rxresp
expect resp.status == 200
expect resp.http.Hello == "vmod-taskvar"
} -run
varnishtest "test vmod-topvar"
server s1 {
rxreq
txresp
} -start
varnish v1 -vcl+backend {
import topvar;
sub vcl_deliver {
set resp.http.Hello = topvar.hello();
}
} -start
client c1 {
txreq
rxresp
expect resp.status == 200
expect resp.http.Hello == "vmod-topvar"
} -run
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