export PKG_CONFIG_PATH, else pkg-config doesn't pick it up
authorMichael Wallner <mike@php.net>
Tue, 27 Feb 2018 07:27:26 +0000 (08:27 +0100)
committerMichael Wallner <mike@php.net>
Tue, 27 Feb 2018 07:27:26 +0000 (08:27 +0100)
autoconf/pecl/pecl.m4

index 6721e1c..a1df4f0 100644 (file)
@@ -332,8 +332,16 @@ dnl PECL_CHECK_PKGCONFIG(pkg[, additional-pkg-config-path])
 dnl
 AC_DEFUN([PECL_CHECK_PKGCONFIG], [dnl
        AC_REQUIRE([PECL_PROG_PKGCONFIG])dnl
-       ifelse($2,,,PKG_CONFIG_PATH="$2/lib/pkgconfig:$PKG_CONFIG_PATH")
+       ifelse($2,,, [
+               PECL_SAVE_VAR(pkgconfig_path)="$PKG_CONFIG_PATH"
+               if test -d "$2"; then
+                       export PKG_CONFIG_PATH="$2/lib/pkgconfig:$PKG_CONFIG_PATH"
+               fi
+       ])
        PECL_CHECK_CONFIG([$1], [$PKG_CONFIG $1], [--modversion], [--cflags-only-I], [--libs-only-L], [--libs-only-l])
+       ifelse($2,,, [
+               PKG_CONFIG_PATH="$PECL_SAVE_VAR(pkgconfig_path)"
+       ])
 ])
 dnl
 dnl PECL_CHECK_DONE(name, success[, incline, libline])