Imported Upstream version 0.18.3.2
[platform/upstream/gettext.git] / gettext-runtime / libasprintf / INSTALL
1 These are generic installation instructions.
2
3 Prerequisites
4 =============
5
6    This package depends on a few other packages.  They are listed in
7 the file ‘DEPENDENCIES’.  It is recommended to install the listed
8 packages before installing this package.
9
10 Basic Installation
11 ==================
12
13    The ‘configure’ shell script attempts to guess correct values for
14 various system-dependent variables used during compilation.  It uses
15 those values to create a ‘Makefile’ in each directory of the package.
16 It may also create one or more ‘.h’ files containing system-dependent
17 definitions.  Finally, it creates a shell script ‘config.status’ that
18 you can run in the future to recreate the current configuration, a file
19 ‘config.cache’ that saves the results of its tests to speed up
20 reconfiguring, and a file ‘config.log’ containing compiler output
21 (useful mainly for debugging ‘configure’).
22
23    If you need to do unusual things to compile the package, please try
24 to figure out how ‘configure’ could check whether to do them, and mail
25 diffs or instructions to the address given in the ‘README’ so they can
26 be considered for the next release.  If at some point ‘config.cache’
27 contains results you don't want to keep, you may remove or edit it.
28
29    The file ‘configure.ac’ is used to create ‘configure’ by a program
30 called ‘autoconf’.  You only need ‘configure.ac’ if you want to change
31 it or regenerate ‘configure’ using a newer version of ‘autoconf’.
32
33 The simplest way to compile this package is:
34
35   1. ‘cd’ to the directory containing the package's source code and type
36      ‘./configure’ to configure the package for your system.  If you're
37      using ‘csh’ on an old version of System V, you might need to type
38      ‘sh ./configure’ instead to prevent ‘csh’ from trying to execute
39      ‘configure’ itself.
40
41      Running ‘configure’ takes awhile.  While running, it prints some
42      messages telling which features it is checking for.
43
44   2. Type ‘make’ to compile the package.
45
46   3. Optionally, type ‘make check’ to run any self-tests that come with
47      the package.
48
49   4. Type ‘make install’ to install the programs and any data files and
50      documentation.
51
52   5. You can remove the program binaries and object files from the
53      source code directory by typing ‘make clean’.  To also remove the
54      files that ‘configure’ created (so you can compile the package for
55      a different kind of computer), type ‘make distclean’.  There is
56      also a ‘make maintainer-clean’ target, but that is intended mainly
57      for the package's developers.  If you use it, you may have to get
58      all sorts of other programs in order to regenerate files that came
59      with the distribution.
60
61 Compilers and Options
62 =====================
63
64    Some systems require unusual options for compilation or linking that
65 the ‘configure’ script does not know about.  You can give ‘configure’
66 initial values for variables as arguments.  You can do it like this:
67      ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
68
69 Compiling For Multiple Architectures
70 ====================================
71
72    You can compile the package for more than one kind of computer at the
73 same time, by placing the object files for each architecture in their
74 own directory.  To do this, you must use a version of ‘make’ that
75 supports the ‘VPATH’ variable, such as GNU ‘make’.  ‘cd’ to the
76 directory where you want the object files and executables to go and run
77 the ‘configure’ script.  ‘configure’ automatically checks for the
78 source code in the directory that ‘configure’ is in and in ‘..’.
79
80    If you have to use a ‘make’ that does not supports the ‘VPATH’
81 variable, you have to compile the package for one architecture at a time
82 in the source code directory.  After you have installed the package for
83 one architecture, use ‘make distclean’ before reconfiguring for another
84 architecture.
85
86    On MacOS X 10.5 and later systems, you can create libraries and
87 executables that work on multiple system types--known as "fat" or
88 "universal" binaries--by specifying multiple '-arch' options to the
89 compiler but only a single '-arch' option to the preprocessor.  Like
90 this:
91
92      ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
93                  CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
94                  CPP="gcc -E" CXXCPP="g++ -E"
95
96    This is not guaranteed to produce working output in all cases.  You
97 may have to build one architecture at a time and combine the results
98 using the 'lipo' tool if you have problems.
99
100 Installation Names
101 ==================
102
103    By default, ‘make install’ will install the package's files in
104 ‘/usr/local/bin’, ‘/usr/local/man’, etc.  You can specify an
105 installation prefix other than ‘/usr/local’ by giving ‘configure’ the
106 option ‘--prefix=PATH’.
107
108    You can specify separate installation prefixes for
109 architecture-specific files and architecture-independent files.  If you
110 give ‘configure’ the option ‘--exec-prefix=PATH’, the package will use
111 PATH as the prefix for installing programs and libraries.
112 Documentation and other data files will still use the regular prefix.
113
114    In addition, if you use an unusual directory layout you can give
115 options like ‘--bindir=PATH’ to specify different values for particular
116 kinds of files.  Run ‘configure --help’ for a list of the directories
117 you can set and what kinds of files go in them.
118
119    If the package supports it, you can cause programs to be installed
120 with an extra prefix or suffix on their names by giving ‘configure’ the
121 option ‘--program-prefix=PREFIX’ or ‘--program-suffix=SUFFIX’.
122
123 Enabling Relocatability
124 =======================
125
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.
132
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
137 same binary package.
138
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.
144
145    To configure a program to be relocatable, add ‘--enable-relocatable’
146 to the ‘configure’ command line.
147
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
156 that directory.
157
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
163 searching.
164
165    Here's a sample installation run that takes into account all these
166 recommendations:
167
168      ./configure --enable-relocatable --prefix=/nonexistent
169      make
170      make install DESTDIR=/tmp/inst$$
171
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.
177
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).
182
183 Optional Features
184 =================
185
186    Some packages pay attention to ‘--enable-FEATURE’ options to
187 ‘configure’, where FEATURE indicates an optional part of the package.
188 They may also pay attention to ‘--with-PACKAGE’ options, where PACKAGE
189 is something like ‘gnu-as’ or ‘x’ (for the X Window System).  The
190 ‘README’ should mention any ‘--enable-’ and ‘--with-’ options that the
191 package recognizes.
192
193    For packages that use the X Window System, ‘configure’ can usually
194 find the X include and library files automatically, but if it doesn't,
195 you can use the ‘configure’ options ‘--x-includes=DIR’ and
196 ‘--x-libraries=DIR’ to specify their locations.
197
198    For packages that use the GNU libiconv library, you can use the
199 ‘configure’ option ‘--with-libiconv-prefix’ to specify the prefix you
200 used while installing GNU libiconv.  This option is not necessary if
201 that other prefix is the same as the one now specified through --prefix.
202
203    For packages that use the GNU libintl library, you can use the
204 ‘configure’ option ‘--with-libintl-prefix’ to specify the prefix you
205 used while installing GNU gettext-runtime.  This option is not necessary if
206 that other prefix is the same as the one now specified through --prefix.
207
208 Particular Systems
209 ==================
210
211    On HP-UX, the default C compiler is not ANSI C compatible.  If GNU CC
212 is not installed, it is recommended to use the following options in order
213 to use an ANSI C compiler:
214
215      ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
216
217 and if that doesn't work, install pre-built binaries of GCC for HP-UX.
218
219    On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
220 parse its ‘<wchar.h>’ header file.  The option ‘-nodtk’ can be used as
221 a workaround.  If GNU CC is not installed, it is therefore recommended
222 to try
223
224      ./configure CC="cc"
225
226 and if that doesn't work, try
227
228      ./configure CC="cc -nodtk"
229
230    On AIX 3, the C include files by default don't define some necessary
231 prototype declarations.  If GNU CC is not installed, it is recommended to
232 use the following options:
233
234      ./configure CC="xlc -D_ALL_SOURCE"
235
236    On Haiku, software installed for all users goes in /boot/common, not
237 /usr/local.  It is recommended to use the following options:
238
239      ./configure --prefix=/boot/common
240
241    On BeOS, user installed software goes in /boot/home/config, not
242 /usr/local.  It is recommended to use the following options:
243
244      ./configure --prefix=/boot/home/config
245
246 Specifying the System Type
247 ==========================
248
249    There may be some features ‘configure’ can not figure out
250 automatically, but needs to determine by the type of host the package
251 will run on.  Usually ‘configure’ can figure that out, but if it prints
252 a message saying it can not guess the host type, give it the
253 ‘--host=TYPE’ option.  TYPE can either be a short name for the system
254 type, such as ‘sun4’, or a canonical name with three fields:
255      CPU-COMPANY-SYSTEM
256
257 See the file ‘config.sub’ for the possible values of each field.  If
258 ‘config.sub’ isn't included in this package, then this package doesn't
259 need to know the host type.
260
261    If you are building compiler tools for cross-compiling, you can also
262 use the ‘--target=TYPE’ option to select the type of system they will
263 produce code for and the ‘--build=TYPE’ option to select the type of
264 system on which you are compiling the package.
265
266 Sharing Defaults
267 ================
268
269    If you want to set default values for ‘configure’ scripts to share,
270 you can create a site shell script called ‘config.site’ that gives
271 default values for variables like ‘CC’, ‘cache_file’, and ‘prefix’.
272 ‘configure’ looks for ‘PREFIX/share/config.site’ if it exists, then
273 ‘PREFIX/etc/config.site’ if it exists.  Or, you can set the
274 ‘CONFIG_SITE’ environment variable to the location of the site script.
275 A warning: not all ‘configure’ scripts look for a site script.
276
277 Operation Controls
278 ==================
279
280    ‘configure’ recognizes the following options to control how it
281 operates.
282
283 ‘--cache-file=FILE’
284      Use and save the results of the tests in FILE instead of
285      ‘./config.cache’.  Set FILE to ‘/dev/null’ to disable caching, for
286      debugging ‘configure’.
287
288 ‘--help’
289      Print a summary of the options to ‘configure’, and exit.
290
291 ‘--quiet’
292 ‘--silent’
293 ‘-q’
294      Do not print messages saying which checks are being made.  To
295      suppress all normal output, redirect it to ‘/dev/null’ (any error
296      messages will still be shown).
297
298 ‘--srcdir=DIR’
299      Look for the package's source code in directory DIR.  Usually
300      ‘configure’ can determine that directory automatically.
301
302 ‘--version’
303      Print the version of Autoconf used to generate the ‘configure’
304      script, and exit.
305
306 ‘configure’ also accepts some other, not widely useful, options.
307