annotate build-aux/install-reloc @ 9238:6d715fbc981c

Change xreadlink module to use areadlink.
author Bruno Haible <bruno@clisp.org>
date Sun, 30 Sep 2007 04:17:42 +0200
parents 53b90318e324
children bbbbbf4cd1c5
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
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
8279
ca03b672badc Break long lines.
Bruno Haible <bruno@clisp.org>
parents: 8272
diff changeset
3 # Copyright (C) 2003, 2005-2007 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 #
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6 # This program is free software; you can redistribute it and/or modify
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
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8 # the Free Software Foundation; either version 2, or (at your option)
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 # any later version.
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
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 # along with this program; if not, write to the Free Software Foundation,
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20 # Usage:
8279
ca03b672badc Break long lines.
Bruno Haible <bruno@clisp.org>
parents: 8272
diff changeset
21 # install-reloc library_path_var library_path_value prefix \
ca03b672badc Break long lines.
Bruno Haible <bruno@clisp.org>
parents: 8272
diff changeset
22 # compile_command srcdir config_h_dir exeext \
ca03b672badc Break long lines.
Bruno Haible <bruno@clisp.org>
parents: 8272
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
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29 # - 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
30 # - 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
31 # - 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
32 # alloca.h and stdbool.h)
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
33 # - 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
34 # - exeext is platform dependent suffix of executables
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
35 # - install-command is the install command line, excluding the final destprog
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
36 # - destprog is the destination program name
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37 # 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
38 # wrapper in the place of destprog.
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
39
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
40 progname=$0
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
41
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
42 if test $# -eq 2; then
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
43 # Get arguments from environment variables.
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
44 library_path_var=$RELOC_LIBRARY_PATH_VAR
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
45 library_path_value=$RELOC_LIBRARY_PATH_VALUE
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
46 prefix=$RELOC_PREFIX
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
47 compile_command=$RELOC_COMPILE_COMMAND
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
48 srcdir=$RELOC_SRCDIR
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
49 builddir=$RELOC_BUILDDIR
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
50 config_h_dir=$RELOC_CONFIG_H_DIR
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
51 exeext=$RELOC_EXEEXT
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
52 install_prog=$RELOC_INSTALL_PROG # including the "-c" option
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
53 else
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
54 if test $# -ge 9; then
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
55 # Get fixed position arguments.
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
56 library_path_var=$1
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
57 library_path_value=$2
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
58 prefix=$3
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
59 compile_command=$4
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
60 srcdir=$5
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
61 builddir=$6
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
62 config_h_dir=$7
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
63 exeext=$8
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
64 install_prog=$9 # maybe not including the "-c" option
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
65 shift
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
66 shift
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
67 shift
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
68 shift
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
69 shift
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
70 shift
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
71 shift
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
72 shift
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
73 shift
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
74 else
8279
ca03b672badc Break long lines.
Bruno Haible <bruno@clisp.org>
parents: 8272
diff changeset
75 echo "Usage: $0 library_path_var library_path_value prefix" \
ca03b672badc Break long lines.
Bruno Haible <bruno@clisp.org>
parents: 8272
diff changeset
76 "compile_command srcdir builddir config_h_dir exeext" \
ca03b672badc Break long lines.
Bruno Haible <bruno@clisp.org>
parents: 8272
diff changeset
77 "install_command... destprog" 1>&2
8265
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
78 exit 1
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
79 fi
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
80 fi
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
81
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
82 # Get destprog, last argument.
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
83 destprog=
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
84 for arg
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
85 do
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
86 destprog=$arg
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
87 done
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
88 # Remove trailing $exeext, if present.
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
89 if test -n "$exeext"; then
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
90 sedexpr='s|'`echo "$exeext" | sed -e 's,\.,\\\.,g'`'$||'
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
91 destprog=`echo "$destprog" | sed -e "$sedexpr"`
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
92 fi
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
93
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
94 # Outputs a command and runs it.
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
95 func_verbose ()
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
96 {
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
97 echo "$@"
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
98 "$@"
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
99 }
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
100
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
101 # Run install_command.
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
102 func_verbose $install_prog "$@" || exit $?
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
103
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
104 # 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
105 # a wrapper.
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
106 test -n "$library_path_var" || exit 0
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
107
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
108 libdirs=
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
109 save_IFS="$IFS"; IFS=":"
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
110 for dir in $library_path_value; do
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
111 IFS="$save_IFS"
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
112 if test -n "$dir"; then
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
113 case "$libdirs" in
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
114 *"\"$dir\""*) ;; # remove duplicate
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
115 *) libdirs="$libdirs\"$dir\"," ;;
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
116 esac
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
117 fi
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
118 done
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
119 IFS="$save_IFS"
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
120 # 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
121 # wrapper.
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
122 test -n "$libdirs" || exit 0
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
123
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
124 # Compile wrapper.
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
125 installdir=`echo "$destprog" | sed -e 's,/[^/]*$,,'`
8279
ca03b672badc Break long lines.
Bruno Haible <bruno@clisp.org>
parents: 8272
diff changeset
126 func_verbose $compile_command \
ca03b672badc Break long lines.
Bruno Haible <bruno@clisp.org>
parents: 8272
diff changeset
127 -I"$builddir" -I"$srcdir" -I"$config_h_dir" \
ca03b672badc Break long lines.
Bruno Haible <bruno@clisp.org>
parents: 8272
diff changeset
128 -DHAVE_CONFIG_H -DIN_RELOCWRAPPER -DNO_XMALLOC \
ca03b672badc Break long lines.
Bruno Haible <bruno@clisp.org>
parents: 8272
diff changeset
129 -D"INSTALLPREFIX=\"$prefix\"" -D"INSTALLDIR=\"$installdir\"" \
ca03b672badc Break long lines.
Bruno Haible <bruno@clisp.org>
parents: 8272
diff changeset
130 -D"LIBPATHVAR=\"$library_path_var\"" -D"LIBDIRS=$libdirs" \
ca03b672badc Break long lines.
Bruno Haible <bruno@clisp.org>
parents: 8272
diff changeset
131 -D"EXEEXT=\"$exeext\"" \
ca03b672badc Break long lines.
Bruno Haible <bruno@clisp.org>
parents: 8272
diff changeset
132 "$srcdir"/relocwrapper.c \
ca03b672badc Break long lines.
Bruno Haible <bruno@clisp.org>
parents: 8272
diff changeset
133 "$srcdir"/progname.c \
ca03b672badc Break long lines.
Bruno Haible <bruno@clisp.org>
parents: 8272
diff changeset
134 "$srcdir"/progreloc.c \
ca03b672badc Break long lines.
Bruno Haible <bruno@clisp.org>
parents: 8272
diff changeset
135 "$srcdir"/xreadlink.c \
9238
6d715fbc981c Change xreadlink module to use areadlink.
Bruno Haible <bruno@clisp.org>
parents: 8950
diff changeset
136 "$srcdir"/areadlink.c \
8279
ca03b672badc Break long lines.
Bruno Haible <bruno@clisp.org>
parents: 8272
diff changeset
137 "$srcdir"/readlink.c \
ca03b672badc Break long lines.
Bruno Haible <bruno@clisp.org>
parents: 8272
diff changeset
138 "$srcdir"/canonicalize-lgpl.c \
8950
53b90318e324 Update after allocsa -> malloca renaming.
Bruno Haible <bruno@clisp.org>
parents: 8280
diff changeset
139 "$srcdir"/malloca.c \
8279
ca03b672badc Break long lines.
Bruno Haible <bruno@clisp.org>
parents: 8272
diff changeset
140 "$srcdir"/relocatable.c \
ca03b672badc Break long lines.
Bruno Haible <bruno@clisp.org>
parents: 8272
diff changeset
141 "$srcdir"/setenv.c \
ca03b672badc Break long lines.
Bruno Haible <bruno@clisp.org>
parents: 8272
diff changeset
142 "$srcdir"/strerror.c \
ca03b672badc Break long lines.
Bruno Haible <bruno@clisp.org>
parents: 8272
diff changeset
143 "$srcdir"/c-ctype.c \
8280
cf9fed416d8c Avoid leaving object files around.
Bruno Haible <bruno@clisp.org>
parents: 8279
diff changeset
144 -o "$destprog.wrapper$exeext"
cf9fed416d8c Avoid leaving object files around.
Bruno Haible <bruno@clisp.org>
parents: 8279
diff changeset
145 rc=$?
cf9fed416d8c Avoid leaving object files around.
Bruno Haible <bruno@clisp.org>
parents: 8279
diff changeset
146 # Clean up object files left over in the current directory by the native C
cf9fed416d8c Avoid leaving object files around.
Bruno Haible <bruno@clisp.org>
parents: 8279
diff changeset
147 # compilers on Solaris, HP-UX, OSF/1, IRIX.
cf9fed416d8c Avoid leaving object files around.
Bruno Haible <bruno@clisp.org>
parents: 8279
diff changeset
148 rm -f relocwrapper.o \
cf9fed416d8c Avoid leaving object files around.
Bruno Haible <bruno@clisp.org>
parents: 8279
diff changeset
149 progname.o \
cf9fed416d8c Avoid leaving object files around.
Bruno Haible <bruno@clisp.org>
parents: 8279
diff changeset
150 progreloc.o \
cf9fed416d8c Avoid leaving object files around.
Bruno Haible <bruno@clisp.org>
parents: 8279
diff changeset
151 xreadlink.o \
9238
6d715fbc981c Change xreadlink module to use areadlink.
Bruno Haible <bruno@clisp.org>
parents: 8950
diff changeset
152 areadlink.o \
8280
cf9fed416d8c Avoid leaving object files around.
Bruno Haible <bruno@clisp.org>
parents: 8279
diff changeset
153 canonicalize-lgpl.o \
8950
53b90318e324 Update after allocsa -> malloca renaming.
Bruno Haible <bruno@clisp.org>
parents: 8280
diff changeset
154 malloca.o \
8280
cf9fed416d8c Avoid leaving object files around.
Bruno Haible <bruno@clisp.org>
parents: 8279
diff changeset
155 relocatable.o \
cf9fed416d8c Avoid leaving object files around.
Bruno Haible <bruno@clisp.org>
parents: 8279
diff changeset
156 setenv.o \
cf9fed416d8c Avoid leaving object files around.
Bruno Haible <bruno@clisp.org>
parents: 8279
diff changeset
157 strerror.o \
cf9fed416d8c Avoid leaving object files around.
Bruno Haible <bruno@clisp.org>
parents: 8279
diff changeset
158 c-ctype.o
cf9fed416d8c Avoid leaving object files around.
Bruno Haible <bruno@clisp.org>
parents: 8279
diff changeset
159 test $rc = 0 || exit $?
8265
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
160
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
161 # Rename $destprog.wrapper -> $destprog -> $destprog.bin.
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
162 ln -f "$destprog$exeext" "$destprog.bin$exeext" \
8279
ca03b672badc Break long lines.
Bruno Haible <bruno@clisp.org>
parents: 8272
diff changeset
163 || { rm -f "$destprog.bin$exeext" \
ca03b672badc Break long lines.
Bruno Haible <bruno@clisp.org>
parents: 8272
diff changeset
164 && cp -p "$destprog$exeext" "$destprog.bin$exeext"; } \
8265
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
165 || exit 1
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
166 mv "$destprog.wrapper$exeext" "$destprog$exeext" || exit 1
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
167
20006894dae4 Infrastructure for relocatable installation, from GNU gettext.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
168 exit 0