summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouke Witteveen <j.witteveen@gmail.com>2024-03-13 15:03:21 (GMT)
committerGitHub <noreply@github.com>2024-03-13 15:03:21 (GMT)
commitcfb1c798b9bbf4dbe875cfc63babfd677d7cddde (patch)
tree6ee38c7ce684f956ba688c33ee67c7cc820931f2
parentca4db46c5abe5b3432b3e7255bbf39265fd9e042 (diff)
downloadhdf5-cfb1c798b9bbf4dbe875cfc63babfd677d7cddde.zip
hdf5-cfb1c798b9bbf4dbe875cfc63babfd677d7cddde.tar.gz
hdf5-cfb1c798b9bbf4dbe875cfc63babfd677d7cddde.tar.bz2
Don't set the rpath when linking statically (#4125)
-rw-r--r--bin/h5cc.in42
-rw-r--r--c++/src/h5c++.in42
-rw-r--r--fortran/src/h5fc.in28
3 files changed, 56 insertions, 56 deletions
diff --git a/bin/h5cc.in b/bin/h5cc.in
index e4d4368..bb290df 100644
--- a/bin/h5cc.in
+++ b/bin/h5cc.in
@@ -327,27 +327,27 @@ if test "x$do_link" = "xyes"; then
fi
link_args="$link_args -L${libdir}"
- case "$kind" in
- gcc|linux*)
- # MacOS X doesn't support the "-Wl,-rpath -Wl," style of linker flags.
- # It appears to want none of them specified.
- case "$host_os" in
- darwin*) flag="" ;;
- *) flag="-Wl,-rpath -Wl," ;;
- esac
- ;;
- hpux*) flag="-Wl,+b -Wl," ;;
- freebsd*|solaris*) flag="-R" ;;
- rs6000*|aix*) flag="-L" ;;
- sgi) flag="-rpath " ;;
- *) flag="" ;;
- esac
-
- if test -n "$flag"; then
- shared_link="${flag}${libdir}"
- fi
-
- if test "x$USE_SHARED_LIB" != "xyes"; then
+ if test "x$USE_SHARED_LIB" = "xyes"; then
+ case "$kind" in
+ gcc|linux*)
+ # MacOS X doesn't support the "-Wl,-rpath -Wl," style of linker flags.
+ # It appears to want none of them specified.
+ case "$host_os" in
+ darwin*) flag="" ;;
+ *) flag="-Wl,-rpath -Wl," ;;
+ esac
+ ;;
+ hpux*) flag="-Wl,+b -Wl," ;;
+ freebsd*|solaris*) flag="-R" ;;
+ rs6000*|aix*) flag="-L" ;;
+ sgi) flag="-rpath " ;;
+ *) flag="" ;;
+ esac
+
+ if test -n "$flag"; then
+ shared_link="${flag}${libdir}"
+ fi
+ else
# The "-lhdf5" & "-lhdf5_hl" flags are in here already...This is a static
# compile though, so change it to the static version (.a) of the library.
new_libraries=""
diff --git a/c++/src/h5c++.in b/c++/src/h5c++.in
index e666ba9..a5c584c 100644
--- a/c++/src/h5c++.in
+++ b/c++/src/h5c++.in
@@ -314,27 +314,27 @@ if test "x$do_link" = "xyes"; then
fi
link_args="$link_args -L${libdir}"
- case "$kind" in
- gcc|linux*)
- # MacOS X doesn't support the "-Wl,-rpath -Wl," style of linker flags.
- # It appears to want none of them specified.
- case "$host_os" in
- darwin*) flag="" ;;
- *) flag="-Wl,-rpath -Wl," ;;
- esac
- ;;
- hpux*) flag="-Wl,+b -Wl," ;;
- freebsd*|solaris*) flag="-R" ;;
- rs6000*|aix*) flag="-L" ;;
- sgi) flag="-rpath " ;;
- *) flag="" ;;
- esac
-
- if test -n "$flag"; then
- shared_link="${flag}${libdir}"
- fi
-
- if test "x$USE_SHARED_LIB" != "xyes"; then
+ if test "x$USE_SHARED_LIB" = "xyes"; then
+ case "$kind" in
+ gcc|linux*)
+ # MacOS X doesn't support the "-Wl,-rpath -Wl," style of linker flags.
+ # It appears to want none of them specified.
+ case "$host_os" in
+ darwin*) flag="" ;;
+ *) flag="-Wl,-rpath -Wl," ;;
+ esac
+ ;;
+ hpux*) flag="-Wl,+b -Wl," ;;
+ freebsd*|solaris*) flag="-R" ;;
+ rs6000*|aix*) flag="-L" ;;
+ sgi) flag="-rpath " ;;
+ *) flag="" ;;
+ esac
+
+ if test -n "$flag"; then
+ shared_link="${flag}${libdir}"
+ fi
+ else
# The "-lhdf5" & "-lhdf5_hl" flags are in here already...This is a static
# compile though, so change it to the static version (.a) of the library.
new_libraries=""
diff --git a/fortran/src/h5fc.in b/fortran/src/h5fc.in
index 6d7329a..f92c523 100644
--- a/fortran/src/h5fc.in
+++ b/fortran/src/h5fc.in
@@ -308,20 +308,20 @@ if test "x$do_link" = "xyes"; then
fi
link_args="$link_args -L${libdir}"
- case "$host_os" in
- linux*) flag="@fortran_linux_linker_option@-rpath -Wl," ;;
- hpux*) flag="-Wl,+b -Wl," ;;
- freebsd*|solaris*) flag="-R" ;;
- rs6000*|aix*) flag="-L" ;;
- sgi) flag="-rpath " ;;
- *) flag="" ;;
- esac
-
- if test -n "$flag"; then
- shared_link="${flag}${libdir}"
- fi
-
- if test "x$USE_SHARED_LIB" != "xyes"; then
+ if test "x$USE_SHARED_LIB" = "xyes"; then
+ case "$host_os" in
+ linux*) flag="@fortran_linux_linker_option@-rpath -Wl," ;;
+ hpux*) flag="-Wl,+b -Wl," ;;
+ freebsd*|solaris*) flag="-R" ;;
+ rs6000*|aix*) flag="-L" ;;
+ sgi) flag="-rpath " ;;
+ *) flag="" ;;
+ esac
+
+ if test -n "$flag"; then
+ shared_link="${flag}${libdir}"
+ fi
+ else
# The hdf5 library "-l" flags are in here already. This is a static
# compile though, so change it to the static versions (.a) of the libraries.
new_libraries=""