summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-02-02 23:46:27 +0300
committerAndrei Karas <akaras@inbox.ru>2017-02-02 23:46:27 +0300
commit31ce259791affb84bd1bfc81bf64cd69edc80d1e (patch)
tree45e3b9221932a457e1b416d5ded41e698421ed30 /scripts
parented915552cf9cb8b9c269b02ef79b0c3d1aab87cb (diff)
downloadspm-31ce259791affb84bd1bfc81bf64cd69edc80d1e.tar.gz
spm-31ce259791affb84bd1bfc81bf64cd69edc80d1e.tar.bz2
spm-31ce259791affb84bd1bfc81bf64cd69edc80d1e.tar.xz
spm-31ce259791affb84bd1bfc81bf64cd69edc80d1e.zip
Add support for LDFLAGS in packages.
New function env_ldflags_path New variable ENV_LDFLAGS_PATH
Diffstat (limited to 'scripts')
-rw-r--r--scripts/include/common.sh23
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 {