summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2013-03-22 21:56:15 (GMT)
committerLarry Knox <lrknox@hdfgroup.org>2013-03-22 21:56:15 (GMT)
commitf593b6e71296c74b2da8790a062c2a6076c8ce6d (patch)
tree717985a70bdb22d0855872a9b2262947e50a28c2
parent99b15244742caf98b5ff634f34d880fd0089d8d4 (diff)
downloadhdf5-f593b6e71296c74b2da8790a062c2a6076c8ce6d.zip
hdf5-f593b6e71296c74b2da8790a062c2a6076c8ce6d.tar.gz
hdf5-f593b6e71296c74b2da8790a062c2a6076c8ce6d.tar.bz2
[svn-r23433] Fix for HDFFV-7996.
Compile scripts will add paths for external libraries linked to executable files that they create. Eliminates need for LD_LIBRARY_PATH for szip in locations not known to ld. Teted on platypus and emu (64bit) in addition to h5committest.
-rw-r--r--c++/src/h5c++.in14
-rw-r--r--fortran/src/h5fc.in14
-rw-r--r--tools/misc/h5cc.in14
3 files changed, 42 insertions, 0 deletions
diff --git a/c++/src/h5c++.in b/c++/src/h5c++.in
index 8928d13..0f17cf1 100644
--- a/c++/src/h5c++.in
+++ b/c++/src/h5c++.in
@@ -334,6 +334,20 @@ if test "x$do_link" = "xyes"; then
if test -n "$flag"; then
shared_link="${flag}${libdir}"
+ # Any libraries in LDFLAGS or H5BLD_LDFLAGS also should have rpaths embedded
+ # in the executables created by h5cc (reduces need for LD_LIBRARY_PATH).
+ if test -n "$LDFLAGS"; then
+ for entry in $LDFLAGS; do
+ extdir=`echo $entry | sed '/^-L/ s/^-L//'`
+ shared_link="${shared_link} ${flag}${extdir}"
+ done
+ fi
+ if test -n "$H5BLD_LDFLAGS"; then
+ for entry in $H5BLD_LDFLAGS; do
+ extdir=`echo $entry | sed '/^-L/ s/^-L//'`
+ shared_link="${shared_link} ${flag}${extdir}"
+ done
+ fi
fi
if test "x$USE_SHARED_LIB" != "xyes"; then
diff --git a/fortran/src/h5fc.in b/fortran/src/h5fc.in
index c58eab0..37f7c71 100644
--- a/fortran/src/h5fc.in
+++ b/fortran/src/h5fc.in
@@ -316,6 +316,20 @@ if test "x$do_link" = "xyes"; then
if test -n "$flag"; then
shared_link="${flag}${libdir}"
+ # Any libraries in LDFLAGS or H5BLD_LDFLAGS also should have rpaths embedded
+ # in the executables created by h5cc (reduces need for LD_LIBRARY_PATH).
+ if test -n "$LDFLAGS"; then
+ for entry in $LDFLAGS; do
+ extdir=`echo $entry | sed '/^-L/ s/^-L//'`
+ shared_link="${shared_link} ${flag}${extdir}"
+ done
+ fi
+ if test -n "$H5BLD_LDFLAGS"; then
+ for entry in $H5BLD_LDFLAGS; do
+ extdir=`echo $entry | sed '/^-L/ s/^-L//'`
+ shared_link="${shared_link} ${flag}${extdir}"
+ done
+ fi
fi
if test "x$USE_SHARED_LIB" != "xyes"; then
diff --git a/tools/misc/h5cc.in b/tools/misc/h5cc.in
index 45143e4..fe11c26 100644
--- a/tools/misc/h5cc.in
+++ b/tools/misc/h5cc.in
@@ -350,6 +350,20 @@ if test "x$do_link" = "xyes"; then
if test -n "$flag"; then
shared_link="${flag}${libdir}"
+ # Any libraries in LDFLAGS or H5BLD_LDFLAGS also should have rpaths embedded
+ # in the executables created by h5cc (reduces need for LD_LIBRARY_PATH).
+ if test -n "$LDFLAGS"; then
+ for entry in $LDFLAGS; do
+ extdir=`echo $entry | sed '/^-L/ s/^-L//'`
+ shared_link="${shared_link} ${flag}${extdir}"
+ done
+ fi
+ if test -n "$H5BLD_LDFLAGS"; then
+ for entry in $H5BLD_LDFLAGS; do
+ extdir=`echo $entry | sed '/^-L/ s/^-L//'`
+ shared_link="${shared_link} ${flag}${extdir}"
+ done
+ fi
fi
if test "x$USE_SHARED_LIB" != "xyes"; then