comparison m4/relocatable.m4 @ 40192:cd38408f509a

relocatable-prog: Use $ORIGIN trick also on GNU/Hurd. * m4/relocatable.m4 (gl_RELOCATABLE_BODY): Use $ORIGIN trick also on Hurd with glibc >= 2.27.
author Bruno Haible <bruno@clisp.org>
date Sat, 23 Feb 2019 21:24:14 +0100
parents ef116535bf1a
children 5fd32d128129
comparison
equal deleted inserted replaced
40191:45dce2bf6e8a 40192:cd38408f509a
1 # relocatable.m4 serial 20 1 # relocatable.m4 serial 21
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
44 case "$host_os" in 43 case "$host_os" in
45 mingw*) is_noop=yes ;; 44 mingw*) is_noop=yes ;;
46 # For the platforms that support $ORIGIN, see 45 # For the platforms that support $ORIGIN, see
47 # <https://lekensteyn.nl/rpath.html>. 46 # <https://lekensteyn.nl/rpath.html>.
48 # glibc systems, Linux with musl libc: yes. Android: no. 47 # 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*) ;; 48 linux*-android*) ;;
51 gnu*) ;;
52 linux* | kfreebsd*) use_elf_origin_trick=yes ;; 49 linux* | kfreebsd*) use_elf_origin_trick=yes ;;
50 # Hurd: <http://lists.gnu.org/archive/html/bug-hurd/2019-02/msg00049.html>
51 # only after the glibc commit from 2018-01-08
52 # <https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=311ba8dc4416467947eff2ab327854f124226309>
53 gnu*)
54 # Test for a glibc version >= 2.27.
55 AC_CHECK_FUNCS([copy_file_range])
56 if test $ac_cv_func_copy_file_range = yes; then
57 use_elf_origin_trick=yes
58 fi
59 ;;
60 changequote(,)dnl
53 # FreeBSD >= 7.3, DragonFly >= 3.0: yes. 61 # FreeBSD >= 7.3, DragonFly >= 3.0: yes.
54 freebsd | freebsd[1-7] | freebsd[1-6].* | freebsd7.[0-2]) ;; 62 freebsd | freebsd[1-7] | freebsd[1-6].* | freebsd7.[0-2]) ;;
55 dragonfly | dragonfly[1-2] | dragonfly[1-2].*) ;; 63 dragonfly | dragonfly[1-2] | dragonfly[1-2].*) ;;
56 freebsd* | dragonfly*) use_elf_origin_trick=yes ;; 64 freebsd* | dragonfly*) use_elf_origin_trick=yes ;;
57 # NetBSD >= 8.0: yes. 65 # NetBSD >= 8.0: yes.
64 # Solaris >= 10: yes. 72 # Solaris >= 10: yes.
65 solaris | solaris2.[1-9] | solaris2.[1-9].*) ;; 73 solaris | solaris2.[1-9] | solaris2.[1-9].*) ;;
66 solaris*) use_elf_origin_trick=yes ;; 74 solaris*) use_elf_origin_trick=yes ;;
67 # Haiku: yes. 75 # Haiku: yes.
68 haiku*) use_elf_origin_trick=yes ;; 76 haiku*) use_elf_origin_trick=yes ;;
77 changequote([,])dnl
69 esac 78 esac
70 changequote([,])dnl
71 if test $is_noop = yes; then 79 if test $is_noop = yes; then
72 RELOCATABLE_LDFLAGS=: 80 RELOCATABLE_LDFLAGS=:
73 AC_SUBST([RELOCATABLE_LDFLAGS]) 81 AC_SUBST([RELOCATABLE_LDFLAGS])
74 else 82 else
75 if test $use_elf_origin_trick = yes; then 83 if test $use_elf_origin_trick = yes; then