summaryrefslogtreecommitdiff
path: root/scripts/functions
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2009-06-17 10:32:01 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2009-06-17 10:32:01 (GMT)
commitf7535c2f62b1e0eb45ae222575d691a104b63d7b (patch)
tree1e3b3bf02257769cbd7232dfba53d073c83232f6 /scripts/functions
parent221701baf79454469f11789c9046fac5ca1f90c2 (diff)
parent302dd084c2e782ea5fdbde1db9f1b2bcda5ac83f (diff)
Merge the gcc-4.4 support.
Diffstat (limited to 'scripts/functions')
-rw-r--r--scripts/functions30
1 files changed, 30 insertions, 0 deletions
diff --git a/scripts/functions b/scripts/functions
index 82bccab..738b400 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -265,6 +265,36 @@ CT_DoYes() {
yes "$1" || true
}
+# Add the specified directory to LD_LIBRARY_PATH, and export it
+# If the specified patch is already present, just export
+# $1: path to add
+# $2: add as 'first' or 'last' path, 'first' is assumed if $2 is empty
+# Usage CT_SetLibPath /some/where/lib [first|last]
+CT_SetLibPath() {
+ local path="$1"
+ local pos="$2"
+
+ case ":${LD_LIBRARY_PATH}:" in
+ *:"${path}":*) ;;
+ *) case "${pos}" in
+ last)
+ CT_DoLog DEBUG "Adding '${path}' at end of LD_LIBRARY_PATH"
+ LD_LIBRARY_PATH="${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}${path}"
+ ;;
+ first|"")
+ CT_DoLog DEBUG "Adding '${path}' at start of LD_LIBRARY_PATH"
+ LD_LIBRARY_PATH="${path}${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}"
+ ;;
+ *)
+ CT_Abort "Incorrect position '${pos}' to add '${path}' to LD_LIBRARY_PATH"
+ ;;
+ esac
+ ;;
+ esac
+ CT_DoLog DEBUG "==> LD_LIBRARY_PATH='${LD_LIBRARY_PATH}'"
+ export LD_LIBRARY_PATH
+}
+
# Get the file name extension of a component
# Usage: CT_GetFileExtension <component_name-component_version> [extension]
# If found, echoes the extension to stdout