Commit f5ca7f35 authored by Nils Goroll's avatar Nils Goroll

update to the latest build env standard from libvmod-example

parent fde9f982
ACLOCAL_AMFLAGS = -I m4 ACLOCAL_AMFLAGS = -I m4 -I ${LIBVARNISHAPI_DATAROOTDIR}/aclocal
SUBDIRS = src SUBDIRS = src
DISTCHECK_CONFIGURE_FLAGS = \
VMOD_DIR='$${libdir}/varnish/vmods'
dist_man_MANS = src/vmod_re.3 dist_man_MANS = src/vmod_re.3
MAINTAINERCLEANFILES = $(dist_man_MANS) MAINTAINERCLEANFILES = $(dist_man_MANS)
...@@ -35,10 +35,19 @@ else ...@@ -35,10 +35,19 @@ else
esac esac
fi fi
# check for varnishapi.m4 in custom paths
dataroot=`pkg-config --variable=datarootdir varnishapi 2>/dev/null`
if [ -z "$dataroot" ] ; then
cat >&2 <<'EOF';
Package varnishapi was not found in the pkg-config search path.
Perhaps you should add the directory containing `varnishapi.pc'
to the PKG_CONFIG_PATH environment variable
EOF
exit 1
fi
set -ex set -ex
aclocal -I m4 -I ${dataroot}/aclocal
$LIBTOOLIZE --copy --force $LIBTOOLIZE --copy --force
aclocal -I m4
autoheader autoheader
automake --add-missing --copy --foreign automake --add-missing --copy --foreign
autoconf autoconf
AC_PREREQ(2.59) AC_PREREQ(2.59)
AC_COPYRIGHT([Copyright (c) 2013-2014 UPLEX Nils Goroll Systemoptimierung]) AC_COPYRIGHT([Copyright (c) 2013-2015 UPLEX Nils Goroll Systemoptimierung])
AC_INIT([libvmod-re], [0.6]) AC_INIT([libvmod-re], [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_re.vcc) AC_CONFIG_SRCDIR(src/vmod_re.vcc)
AM_CONFIG_HEADER(config.h) AM_CONFIG_HEADER(config.h)
...@@ -34,23 +35,39 @@ AC_HEADER_STDC ...@@ -34,23 +35,39 @@ AC_HEADER_STDC
AC_CHECK_HEADERS([stdlib.h]) AC_CHECK_HEADERS([stdlib.h])
AC_CHECK_HEADERS([pthread.h]) AC_CHECK_HEADERS([pthread.h])
# backwards compat with older pkg-config
# - pull in AC_DEFUN from pkg.m4
m4_ifndef([PKG_CHECK_VAR], [
# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
# -------------------------------------------
# Retrieves the value of the pkg-config variable for the given module.
AC_DEFUN([PKG_CHECK_VAR],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
_PKG_CONFIG([$1], [variable="][$3]["], [$2])
AS_VAR_COPY([$1], [pkg_cv_][$1])
AS_VAR_IF([$1], [""], [$5], [$4])dnl
])# PKG_CHECK_VAR
])
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
# Check paths to varnishd and varnishtest AC_PATH_PROG([VARNISHTEST], [varnishtest], [],
AC_ARG_VAR([VARNISHTEST], [path to varnishtest (mandatory for make check)]) [$LIBVARNISHAPI_BINDIR:$LIBVARNISHAPI_SBINDIR:$PATH])
AC_ARG_VAR([VARNISHD], [path to varnishd (mandatory for make check)]) AC_PATH_PROG([VARNISHD], [varnishd], [],
AC_PATH_PROG([VARNISHTEST], [varnishtest]) [$LIBVARNISHAPI_SBINDIR:$LIBVARNISHAPI_BINDIR:$PATH])
AC_PATH_PROG([VARNISHD], [varnishd], [/bin/false],
[${PATH}${PATH_SEPARATOR}/usr/local/sbin${PATH_SEPARATOR}/usr/sbin])
if test "x$VARNISHD" = x; then
AC_MSG_FAILURE([Can't locate varnishd])
fi
if test "x$VARNISHTEST" = x; then
AC_MSG_FAILURE([Can't locate varnishtest])
fi
# This corresponds to FreeBSD's WARNS level 6 # This corresponds to FreeBSD's WARNS level 6
DEVELOPER_CFLAGS="-Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wformat" DEVELOPER_CFLAGS="-Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wformat"
......
...@@ -3,7 +3,7 @@ AM_CPPFLAGS = @VMOD_INCLUDES@ ...@@ -3,7 +3,7 @@ AM_CPPFLAGS = @VMOD_INCLUDES@
vmoddir = @VMOD_DIR@ vmoddir = @VMOD_DIR@
vmod_LTLIBRARIES = libvmod_re.la vmod_LTLIBRARIES = libvmod_re.la
libvmod_re_la_LDFLAGS = -module -export-dynamic -avoid-version libvmod_re_la_LDFLAGS = -module -export-dynamic -avoid-version -shared
libvmod_re_la_SOURCES = \ libvmod_re_la_SOURCES = \
vcc_if.c \ vcc_if.c \
vcc_if.h \ vcc_if.h \
......
#- #-
# Copyright (c) 2014 UPLEX Nils Goroll Systemoptimierung # Copyright (c) 2015 UPLEX Nils Goroll Systemoptimierung
# All rights reserved # All rights reserved
# #
# Authors: Geoffrey Simmons <geoffrey.simmons@uplex.de> # Authors: Geoffrey Simmons <geoffrey.simmons@uplex.de>
...@@ -214,23 +214,13 @@ This sequence should be enough in typical setups: ...@@ -214,23 +214,13 @@ This sequence should be enough in typical setups:
Alternative configs Alternative configs
------------------- -------------------
As with Varnish itself, you can set additional flags and macros in the If you have installed Varnish to a non-standard directory, call
``configure`` step, and/or define environment variables to affect the ``autogen.sh`` and ``configure`` with ``PKG_CONFIG_PATH`` pointing to
build config. the appropriate path. For example, when varnishd configure was called
with ``--prefix=$PREFIX``, use
For example, if you are building the VMOD against a Varnish instance PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig
with a non-standard installation prefix, then set these env variables export PKG_CONFIG_PATH
before running ``configure``:
* PREFIX=/path/to/varnish/install/prefix
* export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
* export ACLOCAL_PATH=$PREFIX/share/aclocal
* export PATH=$PREFIX/bin:$PREFIX/sbin:$PATH
``configure`` must locate the ``varnishtest`` and ``varnishd``
binaries so that ``make check`` can be run. Usually it should be able
to find them, but if necessary you can set the variables
``VARNISHTEST`` and/or ``VARNISHD`` with the full paths.
For developers For developers
-------------- --------------
......
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