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 6721e1c1455f68bf2d01c0bb0c173792aaa72f7e..a1df4f02fd062cc2ed8e5cbfad7bba1bbbc75279 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])