-_PKG_CONFIG([$1][_$2], [variable=$2], [$4])
-if test -z "[$pkg_cv_$1][_$2]"; then
+if test x"$[]m4_toupper([$1][_$2])" = x; then
+ _PKG_CONFIG([$1][_$2], [variable=$2], [$4])
+else
+ pkg_cv_$1[]_$2="$[]m4_toupper([$1][_$2])"
+fi
+
+if test x"[$pkg_cv_$1][_$2]" = x; then