diff options
Diffstat (limited to 'scripts/include/common.sh')
-rw-r--r-- | scripts/include/common.sh | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/scripts/include/common.sh b/scripts/include/common.sh index 0df1bba..d57879b 100644 --- a/scripts/include/common.sh +++ b/scripts/include/common.sh @@ -78,11 +78,26 @@ function env_path { check_error $? } +function env_aclocal_path { + echo "export ACLOCAL_PATH=${bindir}/$1:\$PATH" >>"${envfile}" + check_error $? +} + function env_lib_library_path { echo "export LD_LIBRARY_PATH=${bindir}/$1:\$LD_LIBRARY_PATH" >>"${envfile}" check_error $? } +function env_ldflags_path { + echo "export LDFLAGS=${bindir}/$1 \$LDFLAGS" >>"${envfile}" + check_error $? +} + +function env_cppflags_path { + echo "export CPPFLAGS=${bindir}/$1 \$CPPFLAGS" >>"${envfile}" + check_error $? +} + function env_pkg_config_path { echo "export PKG_CONFIG_PATH=${bindir}/$1:\$PKG_CONFIG_PATH" >>"${envfile}" check_error $? @@ -239,7 +254,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="${packedpaths}${3}${bindir}/$var " + done + unset IFS + echo "export $2=\"${packedpaths}\$$2\"" >>"${envfile}" check_error $? } @@ -249,6 +279,9 @@ function package_use { repack_paths "$ENV_LD_LIBRARY_PATH" "LD_LIBRARY_PATH" 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" + repack_flags "$ENV_CPPFLAGS_PATH" "CPPFLAGS" "-I" } function common_use_package { |