Mercurial > gnulib
annotate build-aux/install-reloc @ 17525:ea01543bbca7
install-reloc: Support multi-binary installation.
* build-aux/install-reloc: Support installing multiple programs in
one invocation, as done by Automake starting with commit
4295fe33eb23f (Multi-file install for PROGRAMS.). From Bruno
Haible <bruno@clisp.org>, archived at
http://lists.debian.org/debian-bsd/2012/05/msg00032.html.
Reported by Sylvain <beuc@gnu.org>.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Mon, 21 Oct 2013 22:48:35 -0700 |
parents | e542fd46ad6f |
children | 344018b6e5d7 |
rev | line source |
---|---|
8265
20006894dae4
Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1 #!/bin/sh |
20006894dae4
Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2 # install-reloc - install a program including a relocating wrapper |
17249
e542fd46ad6f
maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents:
16935
diff
changeset
|
3 # Copyright (C) 2003-2013 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 |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
9238
diff
changeset
|
17 # along with this program. If not, see <http://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: |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
20 # install-reloc -- library_path_var library_path_value prefix destdir \ |
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: |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
43 # env RELOC_LIBRARY_PATH_VAR=library_path_var \ |
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... \ |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
54 # install-reloc prog1 ... destprog |
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. |
8265
20006894dae4
Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
57 # install-reloc renames destprog to destprog.bin and installs a relocating |
20006894dae4
Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
58 # wrapper in the place of destprog. |
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 |
17525
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
62 if test $# -ge 12 && test "x$1" = "x--"; then |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
63 # Get fixed position arguments. |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
64 shift |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
65 library_path_var=$1 |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
66 library_path_value=$2 |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
67 prefix=$3 |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
68 destdir=$4 |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
69 shift |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
70 shift |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
71 shift |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
72 shift |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
73 compile_command=$1 |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
74 srcdir=$2 |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
75 builddir=$3 |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
76 config_h_dir=$4 |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
77 exeext=$5 |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
78 shift |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
79 shift |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
80 shift |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
81 shift |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
82 shift |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
83 strip_prog=$1 |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
84 shift |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
85 install_prog=$1 # maybe not including the "-c" option |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
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. |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
90 library_path_var=$RELOC_LIBRARY_PATH_VAR |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
91 library_path_value=$RELOC_LIBRARY_PATH_VALUE |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
92 prefix=$RELOC_PREFIX |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
93 destdir=$RELOC_DESTDIR |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
94 compile_command=$RELOC_COMPILE_COMMAND |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
95 srcdir=$RELOC_SRCDIR |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
96 builddir=$RELOC_BUILDDIR |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
97 config_h_dir=$RELOC_CONFIG_H_DIR |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
98 exeext=$RELOC_EXEEXT |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
99 strip_prog=$RELOC_STRIP_PROG |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
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 |
17525
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
102 echo "Usage: $0 -- library_path_var library_path_value prefix destdir" \ |
8279 | 103 "compile_command srcdir builddir config_h_dir exeext" \ |
11028
29b9820e29f2
Support for stripping executables in --enable-relocatable.
Bruno Haible <bruno@clisp.org>
parents:
11027
diff
changeset
|
104 "strip_command" \ |
8279 | 105 "install_command... destprog" 1>&2 |
8265
20006894dae4
Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
106 exit 1 |
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 { |
20006894dae4
Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
141 echo "$@" |
20006894dae4
Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
142 "$@" |
20006894dae4
Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
143 } |
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 # Run install_command. |
20006894dae4
Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
146 func_verbose $install_prog "$@" || exit $? |
20006894dae4
Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
147 |
17525
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
148 # Iterate over all destination program names. |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
149 # func_iterate f |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
150 # 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
|
151 sed_basename_of_file='s|^.*/||' |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
152 func_iterate () |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
153 { |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
154 if test -n "$destprog_directory"; then |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
155 prev_arg= |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
156 for arg |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
157 do |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
158 if test -n "prev_arg"; then |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
159 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
|
160 $1 |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
161 fi |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
162 prev_arg="$arg" |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
163 done |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
164 else |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
165 $1 |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
166 fi |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
167 } |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
168 |
11028
29b9820e29f2
Support for stripping executables in --enable-relocatable.
Bruno Haible <bruno@clisp.org>
parents:
11027
diff
changeset
|
169 # Run strip_command. |
17525
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
170 func_strip () |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
171 { |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
172 # Remove trailing $exeext, if present. |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
173 if test -n "$exeext"; then |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
174 destprog=`echo "$destprog" | sed -e "$sed_remove_exeext"` |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
175 fi |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
176 func_verbose "$strip_prog" "$destprog$exeext" || exit $? |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
177 } |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
178 if test "$strip_prog" != ':'; then |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
179 func_iterate func_strip |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
180 fi |
11028
29b9820e29f2
Support for stripping executables in --enable-relocatable.
Bruno Haible <bruno@clisp.org>
parents:
11027
diff
changeset
|
181 |
8265
20006894dae4
Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
182 # If the platform doesn't support LD_LIBRARY_PATH or similar, we cannot build |
20006894dae4
Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
183 # a wrapper. |
20006894dae4
Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
184 test -n "$library_path_var" || exit 0 |
20006894dae4
Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
185 |
20006894dae4
Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
186 libdirs= |
20006894dae4
Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
187 save_IFS="$IFS"; IFS=":" |
20006894dae4
Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
188 for dir in $library_path_value; do |
20006894dae4
Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
189 IFS="$save_IFS" |
20006894dae4
Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
190 if test -n "$dir"; then |
20006894dae4
Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
191 case "$libdirs" in |
20006894dae4
Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
192 *"\"$dir\""*) ;; # remove duplicate |
20006894dae4
Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
193 *) libdirs="$libdirs\"$dir\"," ;; |
20006894dae4
Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
194 esac |
20006894dae4
Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
195 fi |
20006894dae4
Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
196 done |
20006894dae4
Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
197 IFS="$save_IFS" |
20006894dae4
Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
198 # If there are no library directories to add at runtime, we don't need a |
20006894dae4
Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
199 # wrapper. |
20006894dae4
Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
200 test -n "$libdirs" || exit 0 |
20006894dae4
Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
201 |
9548
827a525c7057
Make --enable-relocatable work with DESTDIR.
Bruno Haible <bruno@clisp.org>
parents:
9547
diff
changeset
|
202 # 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
|
203 if test -n "$destprog_directory"; then |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
204 installdir="$destprog_directory" |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
205 else |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
206 installdir=`echo "$destprog" | sed -e 's,/[^/]*$,,'` |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
207 fi |
9548
827a525c7057
Make --enable-relocatable work with DESTDIR.
Bruno Haible <bruno@clisp.org>
parents:
9547
diff
changeset
|
208 if test -n "$destdir"; then |
827a525c7057
Make --enable-relocatable work with DESTDIR.
Bruno Haible <bruno@clisp.org>
parents:
9547
diff
changeset
|
209 sed_quote='s,\([|.\*^$[]\),\\\1,g' |
827a525c7057
Make --enable-relocatable work with DESTDIR.
Bruno Haible <bruno@clisp.org>
parents:
9547
diff
changeset
|
210 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
|
211 installdir=`echo "$installdir" | sed -e "$sed_remove_destdir"` |
827a525c7057
Make --enable-relocatable work with DESTDIR.
Bruno Haible <bruno@clisp.org>
parents:
9547
diff
changeset
|
212 fi |
827a525c7057
Make --enable-relocatable work with DESTDIR.
Bruno Haible <bruno@clisp.org>
parents:
9547
diff
changeset
|
213 |
17525
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
214 # Compile and install wrapper. |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
215 func_create_wrapper () |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
216 { |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
217 # Remove trailing $exeext, if present. |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
218 if test -n "$exeext"; then |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
219 destprog=`echo "$destprog" | sed -e "$sed_remove_exeext"` |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
220 fi |
11026
f7a9849b6394
Remove debugging information left over by C compiler on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
9548
diff
changeset
|
221 |
17525
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
222 # Compile wrapper. |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
223 func_verbose $compile_command \ |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
224 -I"$builddir" -I"$srcdir" -I"$config_h_dir" \ |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
225 -DHAVE_CONFIG_H -DIN_RELOCWRAPPER -DNO_XMALLOC \ |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
226 -D"INSTALLPREFIX=\"$prefix\"" -D"INSTALLDIR=\"$installdir\"" \ |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
227 -D"LIBPATHVAR=\"$library_path_var\"" -D"LIBDIRS=$libdirs" \ |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
228 -D"EXEEXT=\"$exeext\"" \ |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
229 "$srcdir"/relocwrapper.c \ |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
230 "$srcdir"/progname.c \ |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
231 "$srcdir"/progreloc.c \ |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
232 "$srcdir"/areadlink.c \ |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
233 "$srcdir"/careadlinkat.c \ |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
234 "$srcdir"/allocator.c \ |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
235 "$srcdir"/readlink.c \ |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
236 "$srcdir"/canonicalize-lgpl.c \ |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
237 "$srcdir"/malloca.c \ |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
238 "$srcdir"/relocatable.c \ |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
239 "$srcdir"/setenv.c \ |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
240 "$srcdir"/strerror.c \ |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
241 "$srcdir"/c-ctype.c \ |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
242 -o "$destprog.wrapper$exeext" |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
243 rc=$? |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
244 # Clean up object files left over in the current directory by the native C |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
245 # compilers on Solaris, HP-UX, OSF/1, IRIX. |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
246 rm -f relocwrapper.o \ |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
247 progname.o \ |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
248 progreloc.o \ |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
249 areadlink.o \ |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
250 careadlinkat.o \ |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
251 allocator.o \ |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
252 readlink.o \ |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
253 canonicalize-lgpl.o \ |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
254 malloca.o \ |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
255 relocatable.o \ |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
256 setenv.o \ |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
257 strerror.o \ |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
258 c-ctype.o |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
259 test $rc = 0 || exit $? |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
260 # Clean up debugging information left over by the native C compiler on MacOS X. |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
261 rm -rf "$destprog.wrapper$exeext.dSYM" |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
262 test $rc = 0 || exit $? |
11028
29b9820e29f2
Support for stripping executables in --enable-relocatable.
Bruno Haible <bruno@clisp.org>
parents:
11027
diff
changeset
|
263 |
17525
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
264 # Strip wrapper. |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
265 test "$strip_prog" = ':' || func_verbose "$strip_prog" "$destprog.wrapper$exeext" || exit $? |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
266 |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
267 # Rename $destprog.wrapper -> $destprog -> $destprog.bin. |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
268 ln -f "$destprog$exeext" "$destprog.bin$exeext" \ |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
269 || { rm -f "$destprog.bin$exeext" \ |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
270 && cp -p "$destprog$exeext" "$destprog.bin$exeext"; } \ |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
271 || exit 1 |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
272 mv "$destprog.wrapper$exeext" "$destprog$exeext" || exit 1 |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
273 } |
ea01543bbca7
install-reloc: Support multi-binary installation.
Bruno Haible <bruno@clisp.org>
parents:
17249
diff
changeset
|
274 func_iterate func_create_wrapper |
8265
20006894dae4
Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
275 |
20006894dae4
Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
276 exit 0 |