Mercurial > gnulib
comparison m4/relocatable.m4 @ 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 | cd38408f509a |
comparison
equal
deleted
inserted
replaced
40189:3ba41edecde6 | 40190:ef116535bf1a |
---|---|
1 # relocatable.m4 serial 19 | 1 # relocatable.m4 serial 20 |
2 dnl Copyright (C) 2003, 2005-2007, 2009-2019 Free Software Foundation, Inc. | 2 dnl Copyright (C) 2003, 2005-2007, 2009-2019 Free Software Foundation, Inc. |
3 dnl This file is free software; the Free Software Foundation | 3 dnl This file is free software; the Free Software Foundation |
4 dnl gives unlimited permission to copy and/or distribute it, | 4 dnl gives unlimited permission to copy and/or distribute it, |
5 dnl with or without modifications, as long as this notice is preserved. | 5 dnl with or without modifications, as long as this notice is preserved. |
6 | 6 |
38 if test $RELOCATABLE = yes; then | 38 if test $RELOCATABLE = yes; then |
39 # --enable-relocatable implies --disable-rpath | 39 # --enable-relocatable implies --disable-rpath |
40 enable_rpath=no | 40 enable_rpath=no |
41 AC_CHECK_HEADERS([mach-o/dyld.h]) | 41 AC_CHECK_HEADERS([mach-o/dyld.h]) |
42 AC_CHECK_FUNCS([_NSGetExecutablePath]) | 42 AC_CHECK_FUNCS([_NSGetExecutablePath]) |
43 changequote(,)dnl | |
43 case "$host_os" in | 44 case "$host_os" in |
44 mingw*) is_noop=yes ;; | 45 mingw*) is_noop=yes ;; |
46 # For the platforms that support $ORIGIN, see | |
47 # <https://lekensteyn.nl/rpath.html>. | |
48 # glibc systems, Linux with musl libc: yes. Android: no. | |
49 # Hurd: no <http://lists.gnu.org/archive/html/bug-hurd/2019-02/msg00049.html>. | |
50 linux*-android*) ;; | |
51 gnu*) ;; | |
45 linux* | kfreebsd*) use_elf_origin_trick=yes ;; | 52 linux* | kfreebsd*) use_elf_origin_trick=yes ;; |
53 # FreeBSD >= 7.3, DragonFly >= 3.0: yes. | |
54 freebsd | freebsd[1-7] | freebsd[1-6].* | freebsd7.[0-2]) ;; | |
55 dragonfly | dragonfly[1-2] | dragonfly[1-2].*) ;; | |
56 freebsd* | dragonfly*) use_elf_origin_trick=yes ;; | |
57 # NetBSD >= 8.0: yes. | |
58 netbsd | netbsd[1-7] | netbsd[1-7].*) ;; | |
59 netbsdelf | netbsdelf[1-7] | netbsdelf[1-7].*) ;; | |
60 netbsd*) use_elf_origin_trick=yes ;; | |
61 # OpenBSD >= 5.4: yes. | |
62 openbsd | openbsd[1-5] | openbsd[1-4].* | openbsd5.[0-3]) ;; | |
63 openbsd*) use_elf_origin_trick=yes ;; | |
64 # Solaris >= 10: yes. | |
65 solaris | solaris2.[1-9] | solaris2.[1-9].*) ;; | |
66 solaris*) use_elf_origin_trick=yes ;; | |
67 # Haiku: yes. | |
68 haiku*) use_elf_origin_trick=yes ;; | |
46 esac | 69 esac |
70 changequote([,])dnl | |
47 if test $is_noop = yes; then | 71 if test $is_noop = yes; then |
48 RELOCATABLE_LDFLAGS=: | 72 RELOCATABLE_LDFLAGS=: |
49 AC_SUBST([RELOCATABLE_LDFLAGS]) | 73 AC_SUBST([RELOCATABLE_LDFLAGS]) |
50 else | 74 else |
51 if test $use_elf_origin_trick = yes; then | 75 if test $use_elf_origin_trick = yes; then |