diff options
Diffstat (limited to 'scripts/include')
-rw-r--r-- | scripts/include/common.sh | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/scripts/include/common.sh b/scripts/include/common.sh index c61111f..3df470a 100644 --- a/scripts/include/common.sh +++ b/scripts/include/common.sh @@ -88,6 +88,11 @@ function env_lib_library_path { check_error $? } +function env_ldflags_path { + echo "export LDFLAGS=${bindir}/$1 \$LDFLAGS" >>"${envfile}" + check_error $? +} + function env_pkg_config_path { echo "export PKG_CONFIG_PATH=${bindir}/$1:\$PKG_CONFIG_PATH" >>"${envfile}" check_error $? @@ -244,7 +249,22 @@ function repack_paths { packedpaths="${packedpaths}${bindir}/$var:" done unset IFS - echo "export $2=${packedpaths}\$$2" >>"${envfile}" + echo "export $2=\"${packedpaths}\$$2\"" >>"${envfile}" + check_error $? +} + +function repack_flags { + if [[ "$1" == "" ]]; then + return + fi + IFS=":" + packedpaths="" + for var in $1 + do + packedpaths="${3}${packedpaths}${bindir}/$var " + done + unset IFS + echo "export $2=\"${packedpaths}\$$2\"" >>"${envfile}" check_error $? } @@ -255,6 +275,7 @@ function package_use { repack_paths "$ENV_PKG_CONFIG_PATH" "PKG_CONFIG_PATH" repack_paths "$ENV_MANPATH" "MANPATH" repack_paths "$ENV_ACLOCAL_PATH" "ACLOCAL_PATH" + repack_flags "$ENV_LDFLAGS_PATH" "LDFLAGS" "-L" } function common_use_package { |