---
 src/make-helper.sh |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

--- a/src/make-helper.sh
+++ b/src/make-helper.sh
@@ -5,8 +5,10 @@ if [ $# -lt 1 ]; then
 	exit 1
 fi
 
+[ -n "$PKG_CONFIG" ] || PKG_CONFIG=pkg-config
+
 # make sure pkg-config is installed
-if ! type pkg-config >/dev/null 2>&1 ; then echo pkg-config-not-installed; exit 0; fi
+if ! type $PKG_CONFIG >/dev/null 2>&1 ; then echo pkg-config-not-installed; exit 0; fi
 
 cmd="$1"
 shift
@@ -15,11 +17,11 @@ case "${cmd}" in
         pkg_config_libs=""
         for lib in "$@";do
             pkg_config_name="${lib%:*}"
-            if pkg-config --exists "${pkg_config_name}"; then
+            if $PKG_CONFIG --exists "${pkg_config_name}"; then
                 pkg_config_libs="${pkg_config_libs} ${pkg_config_name}"
             fi
         done
-        pkg-config --cflags-only-I "${pkg_config_libs}"
+        $PKG_CONFIG --cflags-only-I "${pkg_config_libs}"
         ;;
 	pkg-config-libs)
         pkg_config_libs=""
@@ -27,13 +29,13 @@ case "${cmd}" in
         for lib in "$@";do
             pkg_config_name="${lib%:*}"
             lib_name="${lib#*:}"
-            if pkg-config --exists "${pkg_config_name}"; then
+            if $PKG_CONFIG --exists "${pkg_config_name}"; then
                 pkg_config_libs="${pkg_config_libs} ${pkg_config_name}"
             else
                 other_libs="${other_libs} -l${lib_name}"
             fi
         done
-        printf %s\\n "$(pkg-config --libs "${pkg_config_libs}") ${other_libs}"
+        printf %s\\n "$($PKG_CONFIG --libs "${pkg_config_libs}") ${other_libs}"
         ;;
 
 	*)
