diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2013-07-21 15:30:15 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2013-07-21 19:44:58 +0300 |
commit | d06b3136f1c52480a9f1c5aa3d38cf557bd7e3e5 (patch) | |
tree | 462efb0904237d4b84166f813cc04edbcb34a5ca /configure.ac | |
download | vmod-tbf-d06b3136f1c52480a9f1c5aa3d38cf557bd7e3e5.tar.gz vmod-tbf-d06b3136f1c52480a9f1c5aa3d38cf557bd7e3e5.tar.bz2 |
Initial commit
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 121 |
1 files changed, 121 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..6c3d58b --- /dev/null +++ b/configure.ac @@ -0,0 +1,121 @@ +# This file is part of vmod-tbf -*- autoconf -*- +# Copyright (C) 2013 Sergey Poznyakoff +# +# Vmod-tbf is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# Vmod-tbf is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with vmod-tbf. If not, see <http://www.gnu.org/licenses/>. +AC_PREREQ(2.69) +AC_INIT([vmod-tbf], 0.99.90, [gray@gnu.org]) +AC_CONFIG_AUX_DIR([build-aux]) +AC_CONFIG_MACRO_DIR([m4]) +AC_CONFIG_SRCDIR(src/vmod_tbf.c) +AM_CONFIG_HEADER(config.h) + +AC_CANONICAL_SYSTEM +AC_LANG(C) + +AM_INIT_AUTOMAKE([gnu tar-ustar]) + +AC_GNU_SOURCE +AC_PROG_CC +AC_PROG_CC_STDC +if test "x$ac_cv_prog_cc_c99" = xno; then + AC_MSG_ERROR([could not find a C99 compatible compiler]) +fi +AC_PROG_CPP + +AC_PROG_INSTALL +AC_PROG_LIBTOOL +AC_PROG_MAKE_SET + +# Check for pkg-config +PKG_PROG_PKG_CONFIG + +# Checks for header files. +AC_HEADER_STDC + +# Check for python +AC_CHECK_PROGS(PYTHON, [python], [ + AC_MSG_ERROR([python is not found.])]) + +# Varnish source tree +AC_ARG_VAR([VARNISHSRC], [path to Varnish source tree]) +AC_ARG_WITH([varnish-source], + AC_HELP_STRING([--with-varnish-source=DIR], + [Varnish sources are located in DIR]), + [VARNISHSRC=$withval]) + +if test -z "$VARNISHSRC"; then + AC_MSG_ERROR([no Varnish source tree specified]) +fi +case "$VARNISHSRC" in +/*) ;; +*) AC_MSG_ERROR([varnish source path must be absolute pathname]) +esac + +VARNISHSRC=`cd $VARNISHSRC && pwd` +AC_CHECK_FILE([$VARNISHSRC/include/varnishapi.h], + [], + [AC_MSG_FAILURE(["$VARNISHSRC" is not a Varnish source directory])]) + +# Check that varnishtest is built in the varnish source directory +AC_CHECK_FILE([$VARNISHSRC/bin/varnishtest/varnishtest], + [], + [AC_MSG_FAILURE([cannot find "$VARNISHSRC/bin/varnishtest/varnishtest". Please build your varnish source directory])] +) + +# vmod installation dir +AC_ARG_VAR([VMODDIR], + [vmod installation directory @<:@LIBDIR/varnish/vmods@:>@]) +AC_ARG_WITH([vmod-dir], + AC_HELP_STRING([--with-vmod-dir@<:@=DIR@:>@], + [install modules to DIR; if used without arguments, install them to the varnish module directory]), + [case "$withval" in + yes) + VMODDIR=`pkg-config --variable=vmoddir varnishapi` + if test -z "$VMODDIR"; then + AC_MSG_FAILURE([cannot determine vmod installation directory]) + fi;; + /*) VMODDIR=$withval;; + *) AC_MSG_ERROR([argument to --with-vmod-dir must be absolute pathname]) + esac]) + +if test -z "$VMODDIR"; then + VMODDIR='$(libdir)/varnish/mods' +fi + +########### +# Check for db.h and libdb +# +AC_CHECK_HEADER([db.h],,[AC_MSG_ERROR([Required header file db.h not found])]) + +AC_CHECK_LIB(db, db_create, + [LIBS="$LIBS -ldb" + AC_RUN_IFELSE( + [AC_LANG_PROGRAM([#include "db.h"], + [int v_major, v_minor, v_patch; + db_version(&v_major, &v_minor, &v_patch); + return !(v_major == DB_VERSION_MAJOR + && v_minor == DB_VERSION_MINOR + && v_patch == DB_VERSION_PATCH); + ])], + [], + [AC_MSG_ERROR([header file db.h is not the same version as libdb])])]) + +dnl FIXME: tests/Makefile +AC_CONFIG_FILES([ + Makefile + src/Makefile + tests/Makefile +]) +AC_OUTPUT + |