From 4dd854cdecf6e203ea3966969332a592a826ffe5 Mon Sep 17 00:00:00 2001 From: PHO Date: Wed, 20 Jun 2012 18:32:27 +0900 Subject: [PATCH] support for PKG_CONFIG_PATH --- Build.rc.example | 7 +++++++ lib/setPath.bash | 16 ++++++++++++---- src/functions.bash | 1 + 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/Build.rc.example b/Build.rc.example index 09795f9..f074d17 100644 --- a/Build.rc.example +++ b/Build.rc.example @@ -17,6 +17,13 @@ setPath PATH \ "/usr/bin" \ "/bin" +# ----------------------------------------------------------------------------- +# The PKG_CONFIG_PATH environment variable to be set during the +# build. (Default: empty) +# +setPath PKG_CONFIG_PATH \ + "/usr/pkg/bin" + # ----------------------------------------------------------------------------- # The extra arguments to be passed to "./configure". # diff --git a/lib/setPath.bash b/lib/setPath.bash index 5158dd6..f41363f 100644 --- a/lib/setPath.bash +++ b/lib/setPath.bash @@ -21,8 +21,16 @@ function setPath () { done esac - # THINKME: Special case for PATH: we prepend "$prefix/bin" to it. - if [[ $var = "PATH" ]]; then - PATH="$prefix/bin:$PATH" - fi + case "$var" in + "PATH") + # THINKME: Special case for PATH: we prepend "$prefix/bin" + # to it. + PATH="$prefix/bin:$PATH";; + "PKG_CONFIG_PATH") + # THINKME: Special case for PKG_CONFIG_PATH: we prepend + # "$prefix/lib/pkgconfig" to it. + PKG_CONFIG_PATH="$prefix/lib/pkgconfig";; + *) + ;; + esac } diff --git a/src/functions.bash b/src/functions.bash index fe7f3df..a9ac44f 100644 --- a/src/functions.bash +++ b/src/functions.bash @@ -12,6 +12,7 @@ function setConfigArgs () { configArgs=( \ --prefix="$prefix" \ PATH="$PATH" \ + PKG_CONFIG_PATH="$PKG_CONFIG_PATH" \ "$@" \ ) } -- 2.40.0