Mercurial > gnulib
diff m4/relocatable.m4 @ 40193:5fd32d128129
relocatable-prog: Use wrapper-free installation also on Mac OS X.
Reported by Paul Smith <psmith@gnu.org>.
* build-aux/install-reloc: Accept a 'mode' argument as first argument.
(func_relativize): New function, from gnulib-tool.
Handle mode 'macosx' through invocations of 'otool' and
'install_name_tool'.
* m4/relocatable.m4 (gl_RELOCATABLE_BODY): Determine use_macos_tools.
If use_macos_tools is true, set INSTALL_PROGRAM_ENV to an
'install-reloc' invocation with mode 'macosx'.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sat, 23 Feb 2019 22:42:54 +0100 |
parents | cd38408f509a |
children | 9734faea5d7b |
line wrap: on
line diff
--- a/m4/relocatable.m4 Sat Feb 23 21:24:14 2019 +0100 +++ b/m4/relocatable.m4 Sat Feb 23 22:42:54 2019 +0100 @@ -1,4 +1,4 @@ -# relocatable.m4 serial 21 +# relocatable.m4 serial 22 dnl Copyright (C) 2003, 2005-2007, 2009-2019 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -34,6 +34,7 @@ AC_REQUIRE([AC_CANONICAL_HOST]) is_noop=no use_elf_origin_trick=no + use_macos_tools=no use_wrapper=no if test $RELOCATABLE = yes; then # --enable-relocatable implies --disable-rpath @@ -74,6 +75,10 @@ solaris*) use_elf_origin_trick=yes ;; # Haiku: yes. haiku*) use_elf_origin_trick=yes ;; + # On Mac OS X 10.4 or newer, use Mac OS X tools. See + # <https://wincent.com/wiki/@executable_path,_@load_path_and_@rpath>. + darwin | darwin[1-8].*) ;; + darwin*) use_macos_tools=yes ;; changequote([,])dnl esac if test $is_noop = yes; then @@ -89,12 +94,16 @@ RELOCATABLE_LDFLAGS="\"$reloc_ldflags\" \"\$(host)\" \"\$(RELOCATABLE_LIBRARY_PATH)\"" AC_SUBST([RELOCATABLE_LDFLAGS]) else - use_wrapper=yes dnl Unfortunately we cannot define INSTALL_PROGRAM to a command dnl consisting of more than one word - libtool doesn't support this. dnl So we abuse the INSTALL_PROGRAM_ENV hook, originally meant for the dnl 'install-strip' target. - INSTALL_PROGRAM_ENV="RELOC_LIBRARY_PATH_VAR=\"$shlibpath_var\" RELOC_LIBRARY_PATH_VALUE=\"\$(RELOCATABLE_LIBRARY_PATH)\" RELOC_PREFIX=\"\$(prefix)\" RELOC_DESTDIR=\"\$(DESTDIR)\" RELOC_COMPILE_COMMAND=\"\$(CC) \$(CPPFLAGS) \$(CFLAGS) \$(LDFLAGS)\" RELOC_SRCDIR=\"\$(RELOCATABLE_SRC_DIR)\" RELOC_BUILDDIR=\"\$(RELOCATABLE_BUILD_DIR)\" RELOC_CONFIG_H_DIR=\"\$(RELOCATABLE_CONFIG_H_DIR)\" RELOC_EXEEXT=\"\$(EXEEXT)\" RELOC_STRIP_PROG=\"\$(RELOCATABLE_STRIP)\" RELOC_INSTALL_PROG=\"$INSTALL_PROGRAM\"" + if test $use_macos_tools = yes; then + INSTALL_PROGRAM_ENV="RELOC_MODE=macosx RELOC_PREFIX=\"\$(prefix)\" RELOC_DESTDIR=\"\$(DESTDIR)\" RELOC_STRIP_PROG=\"\$(RELOCATABLE_STRIP)\" RELOC_INSTALL_PROG=\"$INSTALL_PROGRAM\"" + else + use_wrapper=yes + INSTALL_PROGRAM_ENV="RELOC_MODE=wrapper RELOC_LIBRARY_PATH_VAR=\"$shlibpath_var\" RELOC_LIBRARY_PATH_VALUE=\"\$(RELOCATABLE_LIBRARY_PATH)\" RELOC_PREFIX=\"\$(prefix)\" RELOC_DESTDIR=\"\$(DESTDIR)\" RELOC_COMPILE_COMMAND=\"\$(CC) \$(CPPFLAGS) \$(CFLAGS) \$(LDFLAGS)\" RELOC_SRCDIR=\"\$(RELOCATABLE_SRC_DIR)\" RELOC_BUILDDIR=\"\$(RELOCATABLE_BUILD_DIR)\" RELOC_CONFIG_H_DIR=\"\$(RELOCATABLE_CONFIG_H_DIR)\" RELOC_EXEEXT=\"\$(EXEEXT)\" RELOC_STRIP_PROG=\"\$(RELOCATABLE_STRIP)\" RELOC_INSTALL_PROG=\"$INSTALL_PROGRAM\"" + fi AC_SUBST([INSTALL_PROGRAM_ENV]) case "$ac_aux_dir" in /*) INSTALL_PROGRAM="$ac_aux_dir/install-reloc" ;;