Skip to content

Commit

Permalink
Don't set the rpath when linking statically (#4125)
Browse files Browse the repository at this point in the history
  • Loading branch information
joukewitteveen authored Mar 13, 2024
1 parent ca4db46 commit cfb1c79
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 56 deletions.
42 changes: 21 additions & 21 deletions bin/h5cc.in
Original file line number Diff line number Diff line change
Expand Up @@ -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=""
Expand Down
42 changes: 21 additions & 21 deletions c++/src/h5c++.in
Original file line number Diff line number Diff line change
Expand Up @@ -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=""
Expand Down
28 changes: 14 additions & 14 deletions fortran/src/h5fc.in
Original file line number Diff line number Diff line change
Expand Up @@ -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=""
Expand Down

0 comments on commit cfb1c79

Please sign in to comment.