annotate doc/relocatable.texi @ 17363:5a51fb7777a9

sys_select, sys_time: port 2013-01-30 Solaris 2.6 fix to Cygwin Problem reported by Marco Atzeri in <http://lists.gnu.org/archive/html/bug-gnulib/2013-03/msg00000.html>. * lib/sys_select.in.h [HAVE_SYS_SELECT_H && _CYGWIN_SYS_TIME_H]: Simply delegate to the system <sys/select.h> in this case too. Also, pay attention to _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H only if OSF/1, since otherwise Cygwin breaks, and it doesn't seem to be needed on Solaris either. * lib/sys_time.in.h [_CYGWIN_SYS_TIME_H]: Simply delgate to the system <sys/time.h> in this case.
author Paul Eggert <eggert@cs.ucla.edu>
date Tue, 19 Mar 2013 09:08:47 -0700
parents 64131ac8b004
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8267
28ddd7a26347 Documentation of relocatability for users / installers.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 @node Enabling Relocatability
28ddd7a26347 Documentation of relocatability for users / installers.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2 @section Enabling Relocatability
28ddd7a26347 Documentation of relocatability for users / installers.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3
28ddd7a26347 Documentation of relocatability for users / installers.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4 It has been a pain for many users of GNU packages for a long time that
28ddd7a26347 Documentation of relocatability for users / installers.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 packages are not relocatable. It means a user cannot copy a program,
28ddd7a26347 Documentation of relocatability for users / installers.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6 installed by another user on the same machine, to his home directory,
28ddd7a26347 Documentation of relocatability for users / installers.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 and have it work correctly (including i18n). So many users need to go
28ddd7a26347 Documentation of relocatability for users / installers.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8 through @code{configure; make; make install} with all its
28ddd7a26347 Documentation of relocatability for users / installers.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 dependencies, options, and hurdles.
28ddd7a26347 Documentation of relocatability for users / installers.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10
28ddd7a26347 Documentation of relocatability for users / installers.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 Red Hat, Debian, and similar package systems solve the ``ease of
28ddd7a26347 Documentation of relocatability for users / installers.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 installation'' problem, but they hardwire path names, usually to
28ddd7a26347 Documentation of relocatability for users / installers.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13 @file{/usr} or @file{/usr/local}. This means that users need root
28ddd7a26347 Documentation of relocatability for users / installers.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14 privileges to install a binary package, and prevents installing two
28ddd7a26347 Documentation of relocatability for users / installers.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 different versions of the same binary package.
28ddd7a26347 Documentation of relocatability for users / installers.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16
28ddd7a26347 Documentation of relocatability for users / installers.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 A relocatable program can be moved or copied to a different location
12152
64131ac8b004 relocatable: prefer 'file system' over 'filesystem'
Eric Blake <ebb9@byu.net>
parents: 9279
diff changeset
18 on the file system. It is possible to make symlinks to the installed
8267
28ddd7a26347 Documentation of relocatability for users / installers.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 and moved programs, and invoke them through the symlink. It is
28ddd7a26347 Documentation of relocatability for users / installers.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20 possible to do the same thing with a hard link @emph{only} if the hard
28ddd7a26347 Documentation of relocatability for users / installers.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 link file is in the same directory as the real program.
28ddd7a26347 Documentation of relocatability for users / installers.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22
28ddd7a26347 Documentation of relocatability for users / installers.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23 To configure a program to be relocatable, add
9279
079ab5207ac7 Prefer @command as replacement of invalid @program.
Bruno Haible <bruno@clisp.org>
parents: 9277
diff changeset
24 @option{--enable-relocatable} to the @command{configure} command line.
8471
7251aef6b316 Recommend using as prefix a directory that does not exist and will
Ben Pfaff <blp@gnu.org>
parents: 8284
diff changeset
25
7251aef6b316 Recommend using as prefix a directory that does not exist and will
Ben Pfaff <blp@gnu.org>
parents: 8284
diff changeset
26 On some OSes the executables remember the location of shared libraries
8267
28ddd7a26347 Documentation of relocatability for users / installers.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27 and prefer them over any other search path. Therefore, such an
28ddd7a26347 Documentation of relocatability for users / installers.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28 executable will look for its shared libraries first in the original
28ddd7a26347 Documentation of relocatability for users / installers.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29 installation directory and only then in the current installation
8471
7251aef6b316 Recommend using as prefix a directory that does not exist and will
Ben Pfaff <blp@gnu.org>
parents: 8284
diff changeset
30 directory. Thus, for reliability, it is best to also give a
7251aef6b316 Recommend using as prefix a directory that does not exist and will
Ben Pfaff <blp@gnu.org>
parents: 8284
diff changeset
31 @option{--prefix} option pointing to a directory that does not exist
7251aef6b316 Recommend using as prefix a directory that does not exist and will
Ben Pfaff <blp@gnu.org>
parents: 8284
diff changeset
32 now and which never will be created, e.g.@:
7251aef6b316 Recommend using as prefix a directory that does not exist and will
Ben Pfaff <blp@gnu.org>
parents: 8284
diff changeset
33 @option{--prefix=/nonexistent}. You may use
9279
079ab5207ac7 Prefer @command as replacement of invalid @program.
Bruno Haible <bruno@clisp.org>
parents: 9277
diff changeset
34 @code{DESTDIR=@var{dest-dir}} on the @command{make} command line to
8471
7251aef6b316 Recommend using as prefix a directory that does not exist and will
Ben Pfaff <blp@gnu.org>
parents: 8284
diff changeset
35 avoid installing into that directory.
7251aef6b316 Recommend using as prefix a directory that does not exist and will
Ben Pfaff <blp@gnu.org>
parents: 8284
diff changeset
36
7251aef6b316 Recommend using as prefix a directory that does not exist and will
Ben Pfaff <blp@gnu.org>
parents: 8284
diff changeset
37 We do not recommend using a prefix writable by unprivileged users
7251aef6b316 Recommend using as prefix a directory that does not exist and will
Ben Pfaff <blp@gnu.org>
parents: 8284
diff changeset
38 (e.g.@: @file{/tmp/inst$$}) because such a directory can be recreated
7251aef6b316 Recommend using as prefix a directory that does not exist and will
Ben Pfaff <blp@gnu.org>
parents: 8284
diff changeset
39 by an unprivileged user after the original directory has been removed.
7251aef6b316 Recommend using as prefix a directory that does not exist and will
Ben Pfaff <blp@gnu.org>
parents: 8284
diff changeset
40 We also do not recommend prefixes that might be behind an automounter
7251aef6b316 Recommend using as prefix a directory that does not exist and will
Ben Pfaff <blp@gnu.org>
parents: 8284
diff changeset
41 (e.g.@: @file{$HOME/inst$$}) because of the performance impact of
7251aef6b316 Recommend using as prefix a directory that does not exist and will
Ben Pfaff <blp@gnu.org>
parents: 8284
diff changeset
42 directory searching.
7251aef6b316 Recommend using as prefix a directory that does not exist and will
Ben Pfaff <blp@gnu.org>
parents: 8284
diff changeset
43
7251aef6b316 Recommend using as prefix a directory that does not exist and will
Ben Pfaff <blp@gnu.org>
parents: 8284
diff changeset
44 Here's a sample installation run that takes into account all these
7251aef6b316 Recommend using as prefix a directory that does not exist and will
Ben Pfaff <blp@gnu.org>
parents: 8284
diff changeset
45 recommendations:
7251aef6b316 Recommend using as prefix a directory that does not exist and will
Ben Pfaff <blp@gnu.org>
parents: 8284
diff changeset
46
7251aef6b316 Recommend using as prefix a directory that does not exist and will
Ben Pfaff <blp@gnu.org>
parents: 8284
diff changeset
47 @example
7251aef6b316 Recommend using as prefix a directory that does not exist and will
Ben Pfaff <blp@gnu.org>
parents: 8284
diff changeset
48 ./configure --enable-relocatable --prefix=/nonexistent
7251aef6b316 Recommend using as prefix a directory that does not exist and will
Ben Pfaff <blp@gnu.org>
parents: 8284
diff changeset
49 make
7251aef6b316 Recommend using as prefix a directory that does not exist and will
Ben Pfaff <blp@gnu.org>
parents: 8284
diff changeset
50 make install DESTDIR=/tmp/inst$$
7251aef6b316 Recommend using as prefix a directory that does not exist and will
Ben Pfaff <blp@gnu.org>
parents: 8284
diff changeset
51 @end example
8267
28ddd7a26347 Documentation of relocatability for users / installers.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
52
28ddd7a26347 Documentation of relocatability for users / installers.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
53 Installation with @option{--enable-relocatable} will not work for
28ddd7a26347 Documentation of relocatability for users / installers.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
54 setuid or setgid executables, because such executables search only
8278
a461304a8e77 Might not work on OpenBSD.
Bruno Haible <bruno@clisp.org>
parents: 8267
diff changeset
55 system library paths for security reasons. Also, installation with
8284
e504a82e98cf Typo, found by Ben Pfaff.
Bruno Haible <bruno@clisp.org>
parents: 8278
diff changeset
56 @option{--enable-relocatable} might not work on OpenBSD, when the
8278
a461304a8e77 Might not work on OpenBSD.
Bruno Haible <bruno@clisp.org>
parents: 8267
diff changeset
57 package contains shared libraries and libtool versions 1.5.xx are used.
8267
28ddd7a26347 Documentation of relocatability for users / installers.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
58
28ddd7a26347 Documentation of relocatability for users / installers.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
59 The runtime penalty and size penalty are negligible on GNU/Linux (just
28ddd7a26347 Documentation of relocatability for users / installers.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
60 one system call more when an executable is launched), and small on
28ddd7a26347 Documentation of relocatability for users / installers.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
61 other systems (the wrapper program just sets an environment variable
28ddd7a26347 Documentation of relocatability for users / installers.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
62 and executes the real program).