INSTALL 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  1. Installation Instructions
  2. *************************
  3. Basic Installation
  4. ==================
  5. The following shell commands:
  6. test -f configure || ./bootstrap
  7. ./configure
  8. make
  9. make install
  10. should configure, build, and install this package. The first line,
  11. which bootstraps, is intended for developers; when building from
  12. distribution tarballs it does nothing and can be skipped.
  13. The following more-detailed instructions are generic; see the
  14. ‘README’ file for instructions specific to this package. Some packages
  15. provide this ‘INSTALL’ file but do not implement all of the features
  16. documented below. The lack of an optional feature in a given package is
  17. not necessarily a bug. More recommendations for GNU packages can be
  18. found in the GNU Coding Standards.
  19. Many packages have scripts meant for developers instead of ordinary
  20. builders, as they may use developer tools that are less commonly
  21. installed, or they may access the network, which has privacy
  22. implications. If the ‘bootstrap’ shell script exists, it attempts to
  23. build the ‘configure’ shell script and related files, possibly using
  24. developer tools or the network. Because the output of ‘bootstrap’ is
  25. system-independent, it is normally run by a package developer so that
  26. its output can be put into the distribution tarball and ordinary
  27. builders and users need not run ‘bootstrap’. Some packages have
  28. commands like ‘./autopull.sh’ and ‘./autogen.sh’ that you can run
  29. instead of ‘./bootstrap’, for more fine-grained control over
  30. bootstrapping.
  31. The ‘configure’ shell script attempts to guess correct values for
  32. various system-dependent variables used during compilation. It uses
  33. those values to create a ‘Makefile’ in each directory of the package.
  34. It may also create one or more ‘.h’ files containing system-dependent
  35. definitions. Finally, it creates a shell script ‘config.status’ that
  36. you can run in the future to recreate the current configuration, and a
  37. file ‘config.log’ containing output useful for debugging ‘configure’.
  38. It can also use an optional file (typically called ‘config.cache’ and
  39. enabled with ‘--cache-file=config.cache’ or simply ‘-C’) that saves the
  40. results of its tests to speed up reconfiguring. Caching is disabled by
  41. default to prevent problems with accidental use of stale cache files.
  42. If you need to do unusual things to compile the package, please try
  43. to figure out how ‘configure’ could check whether to do them, and mail
  44. diffs or instructions to the address given in the ‘README’ so they can
  45. be considered for the next release. If you are using the cache, and at
  46. some point ‘config.cache’ contains results you don’t want to keep, you
  47. may remove or edit it.
  48. The ‘autoconf’ program generates ‘configure’ from the file
  49. ‘configure.ac’. Normally you should edit ‘configure.ac’ instead of
  50. editing ‘configure’ directly.
  51. The simplest way to compile this package is:
  52. 1. ‘cd’ to the directory containing the package’s source code.
  53. 2. If this is a developer checkout and file ‘configure’ does not yet
  54. exist, type ‘./bootstrap’ to create it. You may need special
  55. developer tools and network access to bootstrap, and the network
  56. access may have privacy implications.
  57. 3. Type ‘./configure’ to configure the package for your system. This
  58. might take a while. While running, ‘configure’ prints messages
  59. telling which features it is checking for.
  60. 4. Type ‘make’ to compile the package.
  61. 5. Optionally, type ‘make check’ to run any self-tests that come with
  62. the package, generally using the just-built uninstalled binaries.
  63. 6. Type ‘make install’ to install the programs and any data files and
  64. documentation. When installing into a prefix owned by root, it is
  65. recommended that the package be configured and built as a regular
  66. user, and only the ‘make install’ phase executed with root
  67. privileges.
  68. 7. Optionally, type ‘make installcheck’ to repeat any self-tests, but
  69. this time using the binaries in their final installed location.
  70. This target does not install anything. Running this target as a
  71. regular user, particularly if the prior ‘make install’ required
  72. root privileges, verifies that the installation completed
  73. correctly.
  74. 8. You can remove the program binaries and object files from the
  75. source code directory by typing ‘make clean’. To also remove the
  76. files that ‘configure’ created (so you can compile the package for
  77. a different kind of computer), type ‘make distclean’. There is
  78. also a ‘make maintainer-clean’ target, but that is intended mainly
  79. for the package’s developers. If you use it, you may have to
  80. bootstrap again.
  81. 9. If the package follows the GNU Coding Standards, you can type ‘make
  82. uninstall’ to remove the installed files.
  83. Compilers and Options
  84. =====================
  85. Some systems require unusual options for compilation or linking that
  86. the ‘configure’ script does not know about. Run ‘./configure --help’
  87. for details on some of the pertinent environment variables.
  88. You can give ‘configure’ initial values for configuration parameters
  89. by setting variables in the command line or in the environment. Here is
  90. an example:
  91. ./configure CC=gcc CFLAGS=-g LIBS=-lposix
  92. See “Defining Variables” for more details.
  93. Compiling For Multiple Architectures
  94. ====================================
  95. You can compile the package for more than one kind of computer at the
  96. same time, by placing the object files for each system in their own
  97. directory. To do this, you can use GNU ‘make’. ‘cd’ to the directory
  98. where you want the object files and executables to go and run the
  99. ‘configure’ script. ‘configure’ automatically checks for the source
  100. code in the directory that ‘configure’ is in and in ‘..’. This is known
  101. as a “VPATH” build.
  102. With a non-GNU ‘make’, it is safer to compile the package for one
  103. system at a time in the source code directory. After you have installed
  104. the package for one system, use ‘make distclean’ before reconfiguring
  105. for another system.
  106. Some platforms, notably macOS, support “fat” or “universal” binaries,
  107. where a single binary can execute on different architectures. On these
  108. platforms you can configure and compile just once, with options specific
  109. to that platform.
  110. Installation Names
  111. ==================
  112. By default, ‘make install’ installs the package’s commands under
  113. ‘/usr/local/bin’, include files under ‘/usr/local/include’, etc. You
  114. can specify an installation prefix other than ‘/usr/local’ by giving
  115. ‘configure’ the option ‘--prefix=PREFIX’, where PREFIX must be an
  116. absolute file name.
  117. You can specify separate installation prefixes for
  118. architecture-specific files and architecture-independent files. If you
  119. pass the option ‘--exec-prefix=PREFIX’ to ‘configure’, the package uses
  120. PREFIX as the prefix for installing programs and libraries.
  121. Documentation and other data files still use the regular prefix.
  122. In addition, if you use an unusual directory layout you can give
  123. options like ‘--bindir=DIR’ to specify different values for particular
  124. kinds of files. Run ‘configure --help’ for a list of the directories
  125. you can set and what kinds of files go in them. In general, the default
  126. for these options is expressed in terms of ‘${prefix}’, so that
  127. specifying just ‘--prefix’ will affect all of the other directory
  128. specifications that were not explicitly provided.
  129. The most portable way to affect installation locations is to pass the
  130. correct locations to ‘configure’; however, many packages provide one or
  131. both of the following shortcuts of passing variable assignments to the
  132. ‘make install’ command line to change installation locations without
  133. having to reconfigure or recompile.
  134. The first method involves providing an override variable for each
  135. affected directory. For example, ‘make install
  136. prefix=/alternate/directory’ will choose an alternate location for all
  137. directory configuration variables that were expressed in terms of
  138. ‘${prefix}’. Any directories that were specified during ‘configure’,
  139. but not in terms of ‘${prefix}’, must each be overridden at install time
  140. for the entire installation to be relocated. The approach of makefile
  141. variable overrides for each directory variable is required by the GNU
  142. Coding Standards, and ideally causes no recompilation. However, some
  143. platforms have known limitations with the semantics of shared libraries
  144. that end up requiring recompilation when using this method, particularly
  145. noticeable in packages that use GNU Libtool.
  146. The second method involves providing the ‘DESTDIR’ variable. For
  147. example, ‘make install DESTDIR=/alternate/directory’ will prepend
  148. ‘/alternate/directory’ before all installation names. The approach of
  149. ‘DESTDIR’ overrides is not required by the GNU Coding Standards, and
  150. does not work on platforms that have drive letters. On the other hand,
  151. it does better at avoiding recompilation issues, and works well even
  152. when some directory options were not specified in terms of ‘${prefix}’
  153. at ‘configure’ time.
  154. Optional Features
  155. =================
  156. If the package supports it, you can cause programs to be installed
  157. with an extra prefix or suffix on their names by giving ‘configure’ the
  158. option ‘--program-prefix=PREFIX’ or ‘--program-suffix=SUFFIX’.
  159. Some packages pay attention to ‘--enable-FEATURE’ and
  160. ‘--disable-FEATURE’ options to ‘configure’, where FEATURE indicates an
  161. optional part of the package. They may also pay attention to
  162. ‘--with-PACKAGE’ and ‘--without-PACKAGE’ options, where PACKAGE is
  163. something like ‘gnu-ld’. ‘./configure --help’ should mention the
  164. ‘--enable-...’ and ‘--with-...’ options that the package recognizes.
  165. Some packages offer the ability to configure how verbose the
  166. execution of ‘make’ will be. For these packages, running ‘./configure
  167. --enable-silent-rules’ sets the default to minimal output, which can be
  168. overridden with ‘make V=1’; while running ‘./configure
  169. --disable-silent-rules’ sets the default to verbose, which can be
  170. overridden with ‘make V=0’.
  171. Specifying a System Type
  172. ========================
  173. By default ‘configure’ builds for the current system. To create
  174. binaries that can run on a different system type, specify a
  175. ‘--host=TYPE’ option along with compiler variables that specify how to
  176. generate object code for TYPE. For example, to create binaries intended
  177. to run on a 64-bit ARM processor:
  178. ./configure --host=aarch64-linux-gnu \
  179. CC=aarch64-linux-gnu-gcc \
  180. CXX=aarch64-linux-gnu-g++
  181. If done on a machine that can execute these binaries (e.g., via
  182. ‘qemu-aarch64’, ‘$QEMU_LD_PREFIX’, and Linux’s ‘binfmt_misc’
  183. capability), the build behaves like a native build. Otherwise it is a
  184. cross-build: ‘configure’ will make cross-compilation guesses instead of
  185. running test programs, and ‘make check’ will not work.
  186. A system type can either be a short name like ‘mingw64’, or a
  187. canonical name like ‘x86_64-pc-linux-gnu’. Canonical names have the
  188. form CPU-COMPANY-SYSTEM where SYSTEM is either OS or KERNEL-OS. To
  189. canonicalize and validate a system type, you can run the command
  190. ‘config.sub’, which is often squirreled away in a subdirectory like
  191. ‘build-aux’. For example:
  192. $ build-aux/config.sub arm64-linux
  193. aarch64-unknown-linux-gnu
  194. $ build-aux/config.sub riscv-lnx
  195. Invalid configuration 'riscv-lnx': OS 'lnx' not recognized
  196. You can look at the ‘config.sub’ file to see which types are recognized.
  197. If the file is absent, this package does not need the system type.
  198. If ‘configure’ fails with the diagnostic “cannot guess build type”.
  199. ‘config.sub’ did not recognize your system’s type. In this case, first
  200. fetch the newest versions of these files from the GNU config package
  201. (https://savannah.gnu.org/projects/config). If that fixes things,
  202. please report it to the maintainers of the package containing
  203. ‘configure’. Otherwise, you can try the configure option ‘--build=TYPE’
  204. where TYPE comes close to your system type; also, please report the
  205. problem to <config-patches@gnu.org>.
  206. For more details about configuring system types, see the Autoconf
  207. documentation.
  208. Sharing Defaults
  209. ================
  210. If you want to set default values for ‘configure’ scripts to share,
  211. you can create a site shell script called ‘config.site’ that gives
  212. default values for variables like ‘CC’, ‘cache_file’, and ‘prefix’.
  213. ‘configure’ looks for ‘PREFIX/share/config.site’ if it exists, then
  214. ‘PREFIX/etc/config.site’ if it exists. Or, you can set the
  215. ‘CONFIG_SITE’ environment variable to the location of the site script.
  216. A warning: not all ‘configure’ scripts look for a site script.
  217. Defining Variables
  218. ==================
  219. Variables not defined in a site shell script can be set in the
  220. environment passed to ‘configure’. However, some packages may run
  221. configure again during the build, and the customized values of these
  222. variables may be lost. In order to avoid this problem, you should set
  223. them in the ‘configure’ command line, using ‘VAR=value’. For example:
  224. ./configure CC=/usr/local2/bin/gcc
  225. causes the specified ‘gcc’ to be used as the C compiler (unless it is
  226. overridden in the site shell script).
  227. Unfortunately, this technique does not work for ‘CONFIG_SHELL’ due to an
  228. Autoconf limitation. Until the limitation is lifted, you can use this
  229. workaround:
  230. CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
  231. ‘configure’ Invocation
  232. ======================
  233. ‘configure’ recognizes the following options to control how it
  234. operates.
  235. ‘--help’
  236. ‘-h’
  237. Print a summary of all of the options to ‘configure’, and exit.
  238. ‘--help=short’
  239. ‘--help=recursive’
  240. Print a summary of the options unique to this package’s
  241. ‘configure’, and exit. The ‘short’ variant lists options used only
  242. in the top level, while the ‘recursive’ variant lists options also
  243. present in any nested packages.
  244. ‘--version’
  245. ‘-V’
  246. Print the version of Autoconf used to generate the ‘configure’
  247. script, and exit.
  248. ‘--cache-file=FILE’
  249. Enable the cache: use and save the results of the tests in FILE,
  250. traditionally ‘config.cache’. FILE defaults to ‘/dev/null’ to
  251. disable caching.
  252. ‘--config-cache’
  253. ‘-C’
  254. Alias for ‘--cache-file=config.cache’.
  255. ‘--srcdir=DIR’
  256. Look for the package’s source code in directory DIR. Usually
  257. ‘configure’ can determine that directory automatically.
  258. ‘--prefix=DIR’
  259. Use DIR as the installation prefix. See “Installation Names” for
  260. more details, including other options available for fine-tuning the
  261. installation locations.
  262. ‘--host=TYPE’
  263. Build binaries for system TYPE. See “Specifying a System Type”.
  264. ‘--enable-FEATURE’
  265. ‘--disable-FEATURE’
  266. Enable or disable the optional FEATURE. See “Optional Features”.
  267. ‘--with-PACKAGE’
  268. ‘--without-PACKAGE’
  269. Use or omit PACKAGE when building. See “Optional Features”.
  270. ‘--quiet’
  271. ‘--silent’
  272. ‘-q’
  273. Do not print messages saying which checks are being made. To
  274. suppress all normal output, redirect it to ‘/dev/null’ (any error
  275. messages will still be shown).
  276. ‘--no-create’
  277. ‘-n’
  278. Run the configure checks, but stop before creating any output
  279. files.
  280. ‘configure’ also recognizes several environment variables, and accepts
  281. some other, less widely useful, options. Run ‘configure --help’ for
  282. more details.
  283. Copyright notice
  284. ================
  285. Copyright © 1994–1996, 1999–2002, 2004–2017, 2020–2023 Free Software
  286. Foundation, Inc.
  287. Copying and distribution of this file, with or without modification,
  288. are permitted in any medium without royalty provided the copyright
  289. notice and this notice are preserved. This file is offered as-is,
  290. without warranty of any kind.