comparison build-aux/reloc-ldflags @ 40190:ef116535bf1a

relocatable-prog: Use $ORIGIN trick on more platforms. * m4/relocatable.m4 (gl_RELOCATABLE_BODY): Use $ORIGIN trick also on FreeBSD >= 7.3, DragonFly >= 3.0, NetBSD >= 8.0, OpenBSD >= 5.4, Solaris >= 10, Haiku. But don't use it on Android. * build-aux/reloc-ldflags: Allow the use of the $ORIGIN trick also on Hurd, FreeBSD, DragonFly, NetBSD, OpenBSD, Solaris, Haiku.
author Bruno Haible <bruno@clisp.org>
date Wed, 20 Feb 2019 02:39:52 +0100
parents b06060465f09
children 770a5696761e
comparison
equal deleted inserted replaced
40189:3ba41edecde6 40190:ef116535bf1a
52 exit 1 52 exit 1
53 ;; 53 ;;
54 esac 54 esac
55 55
56 case "$host_os" in 56 case "$host_os" in
57 linux* | kfreebsd*) 57 linux* | gnu* | kfreebsd* | \
58 freebsd* | dragonfly* | \
59 netbsd* | \
60 openbsd* | \
61 solaris* | \
62 haiku*)
58 rpath= 63 rpath=
59 save_IFS="$IFS"; IFS=":" 64 save_IFS="$IFS"; IFS=":"
60 for dir in $library_path_value; do 65 for dir in $library_path_value; do
61 IFS="$save_IFS" 66 IFS="$save_IFS"
62 case "$dir" in 67 case "$dir" in
87 esac 92 esac
88 done 93 done
89 IFS="$save_IFS" 94 IFS="$save_IFS"
90 # Output it. 95 # Output it.
91 if test -n "$rpath"; then 96 if test -n "$rpath"; then
92 echo "-Wl,-rpath,$rpath" 97 case "$host_os" in
98 # At least some versions of FreeBSD, DragonFly, and OpenBSD need the
99 # linker option "-z origin". See <https://lekensteyn.nl/rpath.html>.
100 freebsd* | dragonfly* | openbsd*)
101 echo "-Wl,-z,origin -Wl,-rpath,$rpath" ;;
102 *)
103 echo "-Wl,-rpath,$rpath" ;;
104 esac
93 fi 105 fi
94 ;; 106 ;;
95 *) 107 *)
96 echo "relocation via rpath not supported on this system: $host" 1>&2 108 echo "relocation via rpath not supported on this system: $host" 1>&2
97 exit 1 109 exit 1