+# Add directory to library search path.
+if ($dh{L_PARAMS}) {
+ my @paths=();
+ # Add to existing paths, if set.
+ push @paths, $ENV{'LD_LIBRARY_PATH'}
+ if exists $ENV{'LD_LIBRARY_PATH'};
+ foreach (split(/:/, $dh{L_PARAMS})) {
+ # Force the path absolute.
+ if (m:^/:) {
+ push @paths, $_;
+ }
+ else {
+ push @paths, getcwd()."/$_";
+ }
+ }
+ $dh{L_PARAMS}=join(':', @paths);
+ $ENV{'LD_LIBRARY_PATH'}=$dh{L_PARAMS};
+ verbose_print("LD_LIBRARY_PATH=$dh{L_PARAMS}");
+}
+