99
120
with an extra prefix or suffix on their names by giving `configure' the
100
121
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
102
Relocatable Installation
103
========================
105
By default, `make install' will install a package with hardwired
106
file names, and the package will not work correctly when copied or
107
moved to a different location in the filesystem.
109
Some packages pay attention to the `--enable-relocatable' option to
110
`configure'. This option makes the entire installed package
111
relocatable. This means, it can be moved or copied to a different
112
location on the filesystem. It is possible to make symlinks to the
113
installed and moved programs, and invoke them through the symlink. It
114
is possible to do the same thing with a hard link _only_ if the hard
115
linked file is in the same directory as the real program.
117
For reliability it is best to give together with --enable-relocatable
118
a `--prefix' option pointing to an otherwise unused (and never used
119
again) directory, for example, `--prefix=/tmp/inst$$'. This is
120
recommended because on some OSes the executables remember the location
121
of shared libraries (and prefer them over LD_LIBRARY_PATH !), therefore
122
such an executable will look for its shared libraries first in the
123
original installation directory and only then in the current
124
installation directory.
126
Installation with `--enable-relocatable' will not work for setuid /
127
setgid executables. (This is because such an executable kills its
128
LD_LIBRARY_PATH variable when it is launched.)
130
The runtime penalty and size penalty are nearly zero on Linux 2.2 or
131
newer (just one system call more when an executable is launched), and
132
small on other systems (the wrapper program just sets an environment
133
variable and execs the real program).
123
Enabling Relocatability
124
=======================
126
It has been a pain for many users of GNU packages for a long time
127
that packages are not relocatable. It means a user cannot copy a
128
program, installed by another user on the same machine, to his home
129
directory, and have it work correctly (including i18n). So many users
130
need to go through `configure; make; make install' with all its
131
dependencies, options, and hurdles.
133
Red Hat, Debian, and similar package systems solve the "ease of
134
installation" problem, but they hardwire path names, usually to `/usr'
135
or `/usr/local'. This means that users need root privileges to install
136
a binary package, and prevents installing two different versions of the
139
A relocatable program can be moved or copied to a different location
140
on the filesystem. It is possible to make symlinks to the installed
141
and moved programs, and invoke them through the symlink. It is possible
142
to do the same thing with a hard link _only_ if the hard link file is
143
in the same directory as the real program.
145
To configure a program to be relocatable, add `--enable-relocatable'
146
to the `configure' command line.
148
On some OSes the executables remember the location of shared
149
libraries and prefer them over any other search path. Therefore, such
150
an executable will look for its shared libraries first in the original
151
installation directory and only then in the current installation
152
directory. Thus, for reliability, it is best to also give a `--prefix'
153
option pointing to a directory that does not exist now and which never
154
will be created, e.g. `--prefix=/nonexistent'. You may use
155
`DESTDIR=DEST-DIR' on the `make' command line to avoid installing into
158
We do not recommend using a prefix writable by unprivileged users
159
(e.g. `/tmp/inst$$') because such a directory can be recreated by an
160
unprivileged user after the original directory has been removed. We
161
also do not recommend prefixes that might be behind an automounter
162
(e.g. `$HOME/inst$$') because of the performance impact of directory
165
Here's a sample installation run that takes into account all these
168
./configure --enable-relocatable --prefix=/nonexistent
170
make install DESTDIR=/tmp/inst$$
172
Installation with `--enable-relocatable' will not work for setuid or
173
setgid executables, because such executables search only system library
174
paths for security reasons. Also, installation with
175
`--enable-relocatable' might not work on OpenBSD, when the package
176
contains shared libraries and libtool versions 1.5.xx are used.
178
The runtime penalty and size penalty are negligible on GNU/Linux
179
(just one system call more when an executable is launched), and small on
180
other systems (the wrapper program just sets an environment variable
181
and executes the real program).
135
183
Optional Features
136
184
=================