annotate build-aux/install-reloc @ 40205:9e8fb35d4032

relocatable-prog: Revert "Use wrapper-free installation on Mac OS X." * build-aux/install-reloc: Revert change. * m4/relocatable.m4 (gl_RELOCATABLE_BODY): Likewise.
author Bruno Haible <bruno@clisp.org>
date Mon, 04 Mar 2019 17:25:04 +0100
parents 19988ebda9fa
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8265
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 #!/bin/sh
40205
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
2 # install-reloc - install a program including a relocating wrapper
40057
b06060465f09 maint: Run 'make update-copyright'
Paul Eggert <eggert@cs.ucla.edu>
parents: 19484
diff changeset
3 # Copyright (C) 2003-2019 Free Software Foundation, Inc.
8265
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4 # Written by Bruno Haible <bruno@clisp.org>, 2003.
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 #
9309
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 9238
diff changeset
6 # This program is free software: you can redistribute it and/or modify
8265
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 # it under the terms of the GNU General Public License as published by
9309
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 9238
diff changeset
8 # the Free Software Foundation; either version 3 of the License, or
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 9238
diff changeset
9 # (at your option) any later version.
8265
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 #
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 # This program is distributed in the hope that it will be useful,
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14 # GNU General Public License for more details.
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 #
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16 # You should have received a copy of the GNU General Public License
19190
9759915b2aca all: prefer https: URLs
Paul Eggert <eggert@cs.ucla.edu>
parents: 18626
diff changeset
17 # along with this program. If not, see <https://www.gnu.org/licenses/>.
8265
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18
17525
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
19 # Usage 1:
40205
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
20 # install-reloc -- library_path_var library_path_value prefix destdir \
17525
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
21 # compile_command srcdir builddir config_h_dir exeext \
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
22 # strip_command \
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
23 # install_command... destprog
8265
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24 # where
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25 # - library_path_var is the platform dependent runtime library path variable
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26 # - library_path_value is a colon separated list of directories that contain
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27 # the libraries at installation time (use this instead of -rpath)
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28 # - prefix is the base directory at installation time
9548
827a525c7057 Make --enable-relocatable work with DESTDIR.
Bruno Haible <bruno@clisp.org>
parents: 9547
diff changeset
29 # - destdir is a string that is prepended to all file names at installation
827a525c7057 Make --enable-relocatable work with DESTDIR.
Bruno Haible <bruno@clisp.org>
parents: 9547
diff changeset
30 # time; it is already prepended to destprog but not to library_path_value
827a525c7057 Make --enable-relocatable work with DESTDIR.
Bruno Haible <bruno@clisp.org>
parents: 9547
diff changeset
31 # and prefix
8265
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32 # - compile_command is a C compiler compilation and linking command
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
33 # - srcdir is the directory where to find relocwrapper.c and its dependencies
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
34 # - builddir is the directory where to find built dependencies (namely,
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
35 # alloca.h and stdbool.h)
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
36 # - config_h_dir is the directory where to find config.h
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37 # - exeext is platform dependent suffix of executables
11028
29b9820e29f2 Support for stripping executables in --enable-relocatable.
Bruno Haible <bruno@clisp.org>
parents: 11027
diff changeset
38 # - strip_command is the command for stripping executables, or : if no
29b9820e29f2 Support for stripping executables in --enable-relocatable.
Bruno Haible <bruno@clisp.org>
parents: 11027
diff changeset
39 # stripping is desired
29b9820e29f2 Support for stripping executables in --enable-relocatable.
Bruno Haible <bruno@clisp.org>
parents: 11027
diff changeset
40 # - install_command is the install command line, excluding the final destprog
8265
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
41 # - destprog is the destination program name
17525
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
42 # Usage 2:
40205
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
43 # env RELOC_LIBRARY_PATH_VAR=library_path_var \
17525
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
44 # RELOC_LIBRARY_PATH_VALUE=library_path_value \
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
45 # RELOC_PREFIX=prefix \
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
46 # RELOC_DESTDIR=destdir \
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
47 # RELOC_COMPILE_COMMAND=compile_command \
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
48 # RELOC_SRCDIR=srcdir \
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
49 # RELOC_BUILDDIR=builddir \
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
50 # RELOC_CONFIG_H_DIR=config_h_dir \
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
51 # RELOC_EXEEXT=exeext \
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
52 # RELOC_STRIP_PROG=strip_command \
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
53 # RELOC_INSTALL_PROG=install_command... \
40205
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
54 # install-reloc prog1 ... destprog
17525
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
55 # where destprog is either the destination program name (when only one program
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
56 # is specified) or the destination directory for all programs.
40205
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
57 # install-reloc renames destprog to destprog.bin and installs a relocating
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
58 # wrapper in the place of destprog.
8265
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
59
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
60 progname=$0
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
61
40205
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
62 if test $# -ge 12 && test "x$1" = "x--"; then
17525
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
63 # Get fixed position arguments.
40205
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
64 shift
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
65 library_path_var=$1
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
66 library_path_value=$2
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
67 prefix=$3
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
68 destdir=$4
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
69 shift
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
70 shift
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
71 shift
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
72 shift
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
73 compile_command=$1
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
74 srcdir=$2
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
75 builddir=$3
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
76 config_h_dir=$4
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
77 exeext=$5
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
78 shift
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
79 shift
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
80 shift
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
81 shift
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
82 shift
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
83 strip_prog=$1
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
84 shift
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
85 install_prog=$1 # maybe not including the "-c" option
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
86 shift
8265
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
87 else
17525
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
88 if test $# -ge 2; then
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
89 # Get arguments from environment variables.
40205
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
90 library_path_var=$RELOC_LIBRARY_PATH_VAR
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
91 library_path_value=$RELOC_LIBRARY_PATH_VALUE
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
92 prefix=$RELOC_PREFIX
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
93 destdir=$RELOC_DESTDIR
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
94 compile_command=$RELOC_COMPILE_COMMAND
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
95 srcdir=$RELOC_SRCDIR
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
96 builddir=$RELOC_BUILDDIR
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
97 config_h_dir=$RELOC_CONFIG_H_DIR
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
98 exeext=$RELOC_EXEEXT
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
99 strip_prog=$RELOC_STRIP_PROG
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
100 install_prog=$RELOC_INSTALL_PROG # including the "-c" option
8265
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
101 else
40205
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
102 echo "Usage: $0 -- library_path_var library_path_value prefix destdir" \
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
103 "compile_command srcdir builddir config_h_dir exeext" \
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
104 "strip_command" \
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
105 "install_command... destprog" 1>&2
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
106 exit 1
8265
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
107 fi
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
108 fi
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
109
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
110 # Get destprog, last argument.
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
111 destprog=
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
112 for arg
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
113 do
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
114 destprog=$arg
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
115 done
17525
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
116 # Determine whether destprog is a program name or a directory name.
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
117 if test -d "$destprog"; then
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
118 sed_remove_trailing_slashes='s|//*$||'
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
119 destprog_directory=`echo "$destprog" | sed -e "$sed_remove_trailing_slashes"`
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
120 if test -z "$destprog_directory"; then
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
121 destprog_directory='/'
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
122 fi
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
123 else
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
124 destprog_directory=
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
125 fi
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
126 # Prepare for remove trailing $exeext, if present.
8265
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
127 if test -n "$exeext"; then
9548
827a525c7057 Make --enable-relocatable work with DESTDIR.
Bruno Haible <bruno@clisp.org>
parents: 9547
diff changeset
128 sed_quote='s,\.,\\.,g'
827a525c7057 Make --enable-relocatable work with DESTDIR.
Bruno Haible <bruno@clisp.org>
parents: 9547
diff changeset
129 sed_remove_exeext='s|'`echo "$exeext" | sed -e "$sed_quote"`'$||'
17525
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
130 fi
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
131 if test -z "$destprog_directory"; then
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
132 # Remove trailing $exeext, if present.
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
133 if test -n "$exeext"; then
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
134 destprog=`echo "$destprog" | sed -e "$sed_remove_exeext"`
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
135 fi
8265
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
136 fi
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
137
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
138 # Outputs a command and runs it.
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
139 func_verbose ()
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
140 {
40200
19988ebda9fa relocatable-prog: Improve verbose output.
Bruno Haible <bruno@clisp.org>
parents: 40193
diff changeset
141 # Make it easy to copy&paste the printed command into a shell in most cases,
19988ebda9fa relocatable-prog: Improve verbose output.
Bruno Haible <bruno@clisp.org>
parents: 40193
diff changeset
142 # by escaping '\\', '"', and '$'. This is not perfect, just good enough.
19988ebda9fa relocatable-prog: Improve verbose output.
Bruno Haible <bruno@clisp.org>
parents: 40193
diff changeset
143 echo "$@" | sed -e 's/\([\\"$]\)/\\\1/g'
8265
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
144 "$@"
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
145 }
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
146
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
147 # Run install_command.
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
148 func_verbose $install_prog "$@" || exit $?
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
149
17525
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
150 # Iterate over all destination program names.
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
151 # func_iterate f
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
152 # applies f to each destination program names, after setting destprog.
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
153 sed_basename_of_file='s|^.*/||'
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
154 func_iterate ()
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
155 {
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
156 if test -n "$destprog_directory"; then
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
157 prev_arg=
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
158 for arg
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
159 do
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
160 if test -n "prev_arg"; then
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
161 destprog="$destprog_directory"/`echo "$prev_arg" | sed -e "$sed_basename_of_file"`
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
162 $1
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
163 fi
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
164 prev_arg="$arg"
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
165 done
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
166 else
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
167 $1
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
168 fi
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
169 }
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
170
11028
29b9820e29f2 Support for stripping executables in --enable-relocatable.
Bruno Haible <bruno@clisp.org>
parents: 11027
diff changeset
171 # Run strip_command.
17525
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
172 func_strip ()
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
173 {
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
174 # Remove trailing $exeext, if present.
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
175 if test -n "$exeext"; then
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
176 destprog=`echo "$destprog" | sed -e "$sed_remove_exeext"`
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
177 fi
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
178 func_verbose "$strip_prog" "$destprog$exeext" || exit $?
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
179 }
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
180 if test "$strip_prog" != ':'; then
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
181 func_iterate func_strip
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
182 fi
11028
29b9820e29f2 Support for stripping executables in --enable-relocatable.
Bruno Haible <bruno@clisp.org>
parents: 11027
diff changeset
183
40205
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
184 # If the platform doesn't support LD_LIBRARY_PATH or similar, we cannot build
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
185 # a wrapper.
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
186 test -n "$library_path_var" || exit 0
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
187
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
188 libdirs=
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
189 save_IFS="$IFS"; IFS=":"
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
190 for dir in $library_path_value; do
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
191 IFS="$save_IFS"
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
192 if test -n "$dir"; then
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
193 case "$libdirs" in
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
194 *"\"$dir\""*) ;; # remove duplicate
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
195 *) libdirs="$libdirs\"$dir\"," ;;
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
196 esac
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
197 fi
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
198 done
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
199 IFS="$save_IFS"
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
200 # If there are no library directories to add at runtime, we don't need a
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
201 # wrapper.
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
202 test -n "$libdirs" || exit 0
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
203
9548
827a525c7057 Make --enable-relocatable work with DESTDIR.
Bruno Haible <bruno@clisp.org>
parents: 9547
diff changeset
204 # Determine installdir from destprog, removing a leading destdir if present.
17525
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
205 if test -n "$destprog_directory"; then
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
206 installdir="$destprog_directory"
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
207 else
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
208 installdir=`echo "$destprog" | sed -e 's,/[^/]*$,,'`
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
209 fi
9548
827a525c7057 Make --enable-relocatable work with DESTDIR.
Bruno Haible <bruno@clisp.org>
parents: 9547
diff changeset
210 if test -n "$destdir"; then
827a525c7057 Make --enable-relocatable work with DESTDIR.
Bruno Haible <bruno@clisp.org>
parents: 9547
diff changeset
211 sed_quote='s,\([|.\*^$[]\),\\\1,g'
827a525c7057 Make --enable-relocatable work with DESTDIR.
Bruno Haible <bruno@clisp.org>
parents: 9547
diff changeset
212 sed_remove_destdir='s|^'`echo "$destdir" | sed -e "$sed_quote"`'||'
827a525c7057 Make --enable-relocatable work with DESTDIR.
Bruno Haible <bruno@clisp.org>
parents: 9547
diff changeset
213 installdir=`echo "$installdir" | sed -e "$sed_remove_destdir"`
827a525c7057 Make --enable-relocatable work with DESTDIR.
Bruno Haible <bruno@clisp.org>
parents: 9547
diff changeset
214 fi
827a525c7057 Make --enable-relocatable work with DESTDIR.
Bruno Haible <bruno@clisp.org>
parents: 9547
diff changeset
215
40205
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
216 # Compile and install wrapper.
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
217 func_create_wrapper ()
17525
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
218 {
40205
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
219 # Remove trailing $exeext, if present.
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
220 if test -n "$exeext"; then
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
221 destprog=`echo "$destprog" | sed -e "$sed_remove_exeext"`
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
222 fi
11026
f7a9849b6394 Remove debugging information left over by C compiler on MacOS X.
Bruno Haible <bruno@clisp.org>
parents: 9548
diff changeset
223
40205
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
224 # Compile wrapper.
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
225 func_verbose $compile_command \
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
226 -I"$builddir" -I"$srcdir" -I"$config_h_dir" \
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
227 -DHAVE_CONFIG_H -DIN_RELOCWRAPPER -DNO_XMALLOC \
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
228 -D"INSTALLPREFIX=\"$prefix\"" -D"INSTALLDIR=\"$installdir\"" \
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
229 -D"LIBPATHVAR=\"$library_path_var\"" -D"LIBDIRS=$libdirs" \
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
230 -D"EXEEXT=\"$exeext\"" \
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
231 "$srcdir"/relocwrapper.c \
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
232 "$srcdir"/progname.c \
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
233 "$srcdir"/progreloc.c \
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
234 "$srcdir"/areadlink.c \
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
235 "$srcdir"/careadlinkat.c \
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
236 "$srcdir"/allocator.c \
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
237 "$srcdir"/readlink.c \
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
238 "$srcdir"/stat.c \
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
239 "$srcdir"/canonicalize-lgpl.c \
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
240 "$srcdir"/malloca.c \
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
241 "$srcdir"/lstat.c \
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
242 "$srcdir"/relocatable.c \
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
243 "$srcdir"/setenv.c \
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
244 "$srcdir"/c-ctype.c \
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
245 -o "$destprog.wrapper$exeext"
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
246 rc=$?
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
247 # Clean up object files left over in the current directory by the native C
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
248 # compilers on Solaris, HP-UX, OSF/1, IRIX.
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
249 rm -f relocwrapper.o \
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
250 progname.o \
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
251 progreloc.o \
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
252 areadlink.o \
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
253 careadlinkat.o \
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
254 allocator.o \
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
255 readlink.o \
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
256 stat.o \
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
257 canonicalize-lgpl.o \
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
258 malloca.o \
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
259 lstat.o \
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
260 relocatable.o \
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
261 setenv.o \
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
262 c-ctype.o
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
263 test $rc = 0 || exit $?
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
264 # Clean up debugging information left over by the native C compiler on MacOS X.
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
265 rm -rf "$destprog.wrapper$exeext.dSYM"
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
266 test $rc = 0 || exit $?
11028
29b9820e29f2 Support for stripping executables in --enable-relocatable.
Bruno Haible <bruno@clisp.org>
parents: 11027
diff changeset
267
40205
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
268 # Strip wrapper.
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
269 test "$strip_prog" = ':' || func_verbose "$strip_prog" "$destprog.wrapper$exeext" || exit $?
17525
ea01543bbca7 install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents: 17249
diff changeset
270
40205
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
271 # Rename $destprog.wrapper -> $destprog -> $destprog.bin.
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
272 ln -f "$destprog$exeext" "$destprog.bin$exeext" \
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
273 || { rm -f "$destprog.bin$exeext" \
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
274 && cp -p "$destprog$exeext" "$destprog.bin$exeext"; } \
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
275 || exit 1
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
276 mv "$destprog.wrapper$exeext" "$destprog$exeext" || exit 1
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
277 }
9e8fb35d4032 relocatable-prog: Revert "Use wrapper-free installation on Mac OS X."
Bruno Haible <bruno@clisp.org>
parents: 40200
diff changeset
278 func_iterate func_create_wrapper
8265
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
279
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
280 exit 0