[4.1] ca3fde2 mv varnish.m4 varnish-legacy.m4

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Tue Sep 13 22:36:14 CEST 2016


commit ca3fde21d263834f9f5c9fee957dcefbd646d6d9
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Tue Sep 13 17:00:25 2016 +0200

    mv varnish.m4 varnish-legacy.m4
    
    This file will now contain legacy macros, that is to say shims to deal
    with older platforms and macros for out-of-tree VMODs introduced with
    Varnish 4.0.0-tp1.
    
    These macros work well but their interfaces aren't ideal and they leave
    too much autotools work to downstream VMOD maintainers. They have also
    suffered a lack of maintenance, like this 3yo comment:
    
        # Uses internal function for now..
    
    New macros will be introduced, but the current macros are left as-is and
    VMOD maintainers won't be forced to upgrade their build system.

diff --git a/Makefile.am b/Makefile.am
index 13a1e97..87d5a9a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -6,7 +6,7 @@ pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = varnishapi.pc
 
 m4dir = $(datadir)/aclocal
-m4_DATA = varnish.m4
+m4_DATA = varnish-legacy.m4
 
 CLEANFILES = cscope.in.out cscope.out cscope.po.out
 EXTRA_DIST = \
@@ -15,7 +15,7 @@ EXTRA_DIST = \
 	LICENSE \
 	autogen.sh \
 	varnishapi.pc.in \
-	varnish.m4
+	varnish-legacy.m4
 
 DISTCHECK_CONFIGURE_FLAGS = \
     --enable-developer-warnings \
diff --git a/varnish-legacy.m4 b/varnish-legacy.m4
new file mode 100644
index 0000000..823a5ca
--- /dev/null
+++ b/varnish-legacy.m4
@@ -0,0 +1,104 @@
+# varnish-legacy.m4 - Macros to locate Varnish header files. -*- Autoconf -*-
+# serial 3 (varnish-4.0)
+
+# Copyright (c) 2013-2015 Varnish Software AS
+# All rights reserved.
+#
+# Author: Tollef Fog Heen <tfheen at varnish-software.com>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+# For compatibility with autoconf < 2.63b
+m4_ifndef([AS_VAR_COPY],
+  [m4_define([AS_VAR_COPY],
+     [AS_LITERAL_IF([$1[]$2], [$1=$$2], [eval $1=\$$2])])])
+
+# VARNISH_VMOD_INCLUDE_DIR([])
+# ----------------------------
+
+AC_DEFUN([VARNISH_VMOD_INCLUDES],
+[
+m4_pattern_forbid([^_?VARNISH[A-Z_]+$])
+m4_pattern_allow([^VARNISH_VMOD(_INCLUDE_DIR|TOOL)$])
+# Check for pkg-config
+PKG_CHECK_EXISTS([varnishapi],[],[
+	if test -z "$PKG_CONFIG"; then
+		AC_MSG_FAILURE(
+[The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+To get pkg-config, see <http://www.freedesktop.org/wiki/Software/pkg-config/>.])
+	else
+		AC_MSG_FAILURE(
+[pkg-config was unable to locate the varnishapi configuration data.
+
+Please check config.log or adjust the PKG_CONFIG_PATH environment
+variable if you installed software in a non-standard prefix.])
+	fi
+])
+
+VARNISH_PKG_GET_VAR([VAPI_INCLUDE_DIR], [pkgincludedir])
+_CPPFLAGS="$CPPFLAGS"
+VMOD_INCLUDES="-I$VAPI_INCLUDE_DIR"
+CPPFLAGS="$VMOD_INCLUDES $CPPFLAGS"
+AC_CHECK_HEADERS([vsha256.h cache/cache.h])
+CPPFLAGS="$_CPPFLAGS"
+AC_SUBST([VMOD_INCLUDES])
+])# VARNISH_VMOD_INCLUDE_DIR
+
+# VARNISH_VMOD_DIR([])
+# --------------------
+
+AC_DEFUN([VARNISH_VMOD_DIR],
+[
+VARNISH_PKG_GET_VAR([VMOD_DIR], [vmoddir])
+AC_SUBST([VMOD_DIR])
+])
+
+# VARNISH_VMODTOOL([])
+# --------------------
+
+AC_DEFUN([VARNISH_VMODTOOL],
+[
+AC_CHECK_PROGS(PYTHON, [python3 python3.1 python3.2 python2.7 python2.6 python2.5 python2 python], "no")
+if test "x$PYTHON" = "xno"; then
+  AC_MSG_ERROR([Python is needed to build, please install python.])
+fi
+VARNISH_PKG_GET_VAR([VMODTOOL], [vmodtool])
+AC_SUBST([VMODTOOL])
+])
+
+# VARNISH_PKG_GET_VAR([VARIABLE, PC_VAR_NAME])
+# -------------------------------
+
+AC_DEFUN([VARNISH_PKG_GET_VAR],
+[
+# Uses internal function for now..
+pkg_failed=no
+_PKG_CONFIG([$1], [variable=][$2], [varnishapi])
+if test "$pkg_failed" = "yes"; then
+   AC_MSG_FAILURE([$2][ not defined, too old Varnish?])
+fi
+AS_VAR_COPY([$1], [pkg_cv_][$1])
+])
diff --git a/varnish.m4 b/varnish.m4
deleted file mode 100644
index 105a224..0000000
--- a/varnish.m4
+++ /dev/null
@@ -1,104 +0,0 @@
-# varnish.m4 - Macros to locate Varnish header files.            -*- Autoconf -*-
-# serial 3 (varnish-4.0)
-
-# Copyright (c) 2013-2015 Varnish Software AS
-# All rights reserved.
-#
-# Author: Tollef Fog Heen <tfheen at varnish-software.com>
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
-#
-
-# For compatibility with autoconf < 2.63b
-m4_ifndef([AS_VAR_COPY],
-  [m4_define([AS_VAR_COPY],
-     [AS_LITERAL_IF([$1[]$2], [$1=$$2], [eval $1=\$$2])])])
-
-# VARNISH_VMOD_INCLUDE_DIR([])
-# ----------------------------
-
-AC_DEFUN([VARNISH_VMOD_INCLUDES],
-[
-m4_pattern_forbid([^_?VARNISH[A-Z_]+$])
-m4_pattern_allow([^VARNISH_VMOD(_INCLUDE_DIR|TOOL)$])
-# Check for pkg-config
-PKG_CHECK_EXISTS([varnishapi],[],[
-	if test -z "$PKG_CONFIG"; then
-		AC_MSG_FAILURE(
-[The pkg-config script could not be found or is too old.  Make sure it
-is in your PATH or set the PKG_CONFIG environment variable to the full
-path to pkg-config.
-
-To get pkg-config, see <http://www.freedesktop.org/wiki/Software/pkg-config/>.])
-	else
-		AC_MSG_FAILURE(
-[pkg-config was unable to locate the varnishapi configuration data.
-
-Please check config.log or adjust the PKG_CONFIG_PATH environment
-variable if you installed software in a non-standard prefix.])
-	fi
-])
-
-VARNISH_PKG_GET_VAR([VAPI_INCLUDE_DIR], [pkgincludedir])
-_CPPFLAGS="$CPPFLAGS"
-VMOD_INCLUDES="-I$VAPI_INCLUDE_DIR"
-CPPFLAGS="$VMOD_INCLUDES $CPPFLAGS"
-AC_CHECK_HEADERS([vsha256.h cache/cache.h])
-CPPFLAGS="$_CPPFLAGS"
-AC_SUBST([VMOD_INCLUDES])
-])# VARNISH_VMOD_INCLUDE_DIR
-
-# VARNISH_VMOD_DIR([])
-# --------------------
-
-AC_DEFUN([VARNISH_VMOD_DIR],
-[
-VARNISH_PKG_GET_VAR([VMOD_DIR], [vmoddir])
-AC_SUBST([VMOD_DIR])
-])
-
-# VARNISH_VMODTOOL([])
-# --------------------
-
-AC_DEFUN([VARNISH_VMODTOOL],
-[
-AC_CHECK_PROGS(PYTHON, [python3 python3.1 python3.2 python2.7 python2.6 python2.5 python2 python], "no")
-if test "x$PYTHON" = "xno"; then
-  AC_MSG_ERROR([Python is needed to build, please install python.])
-fi
-VARNISH_PKG_GET_VAR([VMODTOOL], [vmodtool])
-AC_SUBST([VMODTOOL])
-])
-
-# VARNISH_PKG_GET_VAR([VARIABLE, PC_VAR_NAME])
-# -------------------------------
-
-AC_DEFUN([VARNISH_PKG_GET_VAR],
-[
-# Uses internal function for now..
-pkg_failed=no
-_PKG_CONFIG([$1], [variable=][$2], [varnishapi])
-if test "$pkg_failed" = "yes"; then
-   AC_MSG_FAILURE([$2][ not defined, too old Varnish?])
-fi
-AS_VAR_COPY([$1], [pkg_cv_][$1])
-])



More information about the varnish-commit mailing list