[4.1] fe1c483 Define PKG_CHECK_VAR for legacy systems
Dridi Boukelmoune
dridi.boukelmoune at gmail.com
Tue Sep 13 22:36:14 CEST 2016
commit fe1c48361cd0201d2acd4d182ab204a918818e54
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date: Tue Sep 13 20:59:16 2016 +0200
Define PKG_CHECK_VAR for legacy systems
diff --git a/varnish-legacy.m4 b/varnish-legacy.m4
index 823a5ca..e5e2821 100644
--- a/varnish-legacy.m4
+++ b/varnish-legacy.m4
@@ -1,7 +1,7 @@
# varnish-legacy.m4 - Macros to locate Varnish header files. -*- Autoconf -*-
-# serial 3 (varnish-4.0)
+# serial 4 (varnish-4.0)
-# Copyright (c) 2013-2015 Varnish Software AS
+# Copyright (c) 2013-2016 Varnish Software AS
# All rights reserved.
#
# Author: Tollef Fog Heen <tfheen at varnish-software.com>
@@ -33,6 +33,23 @@ m4_ifndef([AS_VAR_COPY],
[m4_define([AS_VAR_COPY],
[AS_LITERAL_IF([$1[]$2], [$1=$$2], [eval $1=\$$2])])])
+# backward compatibility with older pkg-config
+# 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.
+m4_ifndef([PKG_CHECK_VAR], [
+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
+])
+])
+
# VARNISH_VMOD_INCLUDE_DIR([])
# ----------------------------
More information about the varnish-commit
mailing list