xref: /netbsd-src/external/bsd/file/dist/INSTALL (revision 2cb320433ec85a5f095448335f22f67d50f53f9d)
11b108b8bSchristosInstallation Instructions
21b108b8bSchristos*************************
31b108b8bSchristos
41b108b8bSchristosCopyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
557171280Schristos2006, 2007, 2008, 2009 Free Software Foundation, Inc.
61b108b8bSchristos
7*2cb32043Schristos   This file is free documentation; the Free Software Foundation gives
8*2cb32043Schristosunlimited permission to copy, distribute and modify it.
91b108b8bSchristos
101b108b8bSchristosBasic Installation
111b108b8bSchristos==================
121b108b8bSchristos
131b108b8bSchristos   Briefly, the shell commands `./configure; make; make install' should
141b108b8bSchristosconfigure, build, and install this package.  The following
151b108b8bSchristosmore-detailed instructions are generic; see the `README' file for
16*2cb32043Schristosinstructions specific to this package.
171b108b8bSchristos
181b108b8bSchristos   The `configure' shell script attempts to guess correct values for
191b108b8bSchristosvarious system-dependent variables used during compilation.  It uses
201b108b8bSchristosthose values to create a `Makefile' in each directory of the package.
211b108b8bSchristosIt may also create one or more `.h' files containing system-dependent
221b108b8bSchristosdefinitions.  Finally, it creates a shell script `config.status' that
231b108b8bSchristosyou can run in the future to recreate the current configuration, and a
241b108b8bSchristosfile `config.log' containing compiler output (useful mainly for
251b108b8bSchristosdebugging `configure').
261b108b8bSchristos
271b108b8bSchristos   It can also use an optional file (typically called `config.cache'
281b108b8bSchristosand enabled with `--cache-file=config.cache' or simply `-C') that saves
291b108b8bSchristosthe results of its tests to speed up reconfiguring.  Caching is
301b108b8bSchristosdisabled by default to prevent problems with accidental use of stale
311b108b8bSchristoscache files.
321b108b8bSchristos
331b108b8bSchristos   If you need to do unusual things to compile the package, please try
341b108b8bSchristosto figure out how `configure' could check whether to do them, and mail
351b108b8bSchristosdiffs or instructions to the address given in the `README' so they can
361b108b8bSchristosbe considered for the next release.  If you are using the cache, and at
371b108b8bSchristossome point `config.cache' contains results you don't want to keep, you
381b108b8bSchristosmay remove or edit it.
391b108b8bSchristos
401b108b8bSchristos   The file `configure.ac' (or `configure.in') is used to create
411b108b8bSchristos`configure' by a program called `autoconf'.  You need `configure.ac' if
421b108b8bSchristosyou want to change it or regenerate `configure' using a newer version
431b108b8bSchristosof `autoconf'.
441b108b8bSchristos
451b108b8bSchristosThe simplest way to compile this package is:
461b108b8bSchristos
471b108b8bSchristos  1. `cd' to the directory containing the package's source code and type
481b108b8bSchristos     `./configure' to configure the package for your system.
491b108b8bSchristos
501b108b8bSchristos     Running `configure' might take a while.  While running, it prints
511b108b8bSchristos     some messages telling which features it is checking for.
521b108b8bSchristos
531b108b8bSchristos  2. Type `make' to compile the package.
541b108b8bSchristos
551b108b8bSchristos  3. Optionally, type `make check' to run any self-tests that come with
56*2cb32043Schristos     the package.
571b108b8bSchristos
581b108b8bSchristos  4. Type `make install' to install the programs and any data files and
59*2cb32043Schristos     documentation.
601b108b8bSchristos
61*2cb32043Schristos  5. You can remove the program binaries and object files from the
621b108b8bSchristos     source code directory by typing `make clean'.  To also remove the
631b108b8bSchristos     files that `configure' created (so you can compile the package for
641b108b8bSchristos     a different kind of computer), type `make distclean'.  There is
651b108b8bSchristos     also a `make maintainer-clean' target, but that is intended mainly
661b108b8bSchristos     for the package's developers.  If you use it, you may have to get
671b108b8bSchristos     all sorts of other programs in order to regenerate files that came
681b108b8bSchristos     with the distribution.
691b108b8bSchristos
70*2cb32043Schristos  6. Often, you can also type `make uninstall' to remove the installed
71*2cb32043Schristos     files again.
7257171280Schristos
731b108b8bSchristosCompilers and Options
741b108b8bSchristos=====================
751b108b8bSchristos
7657171280Schristos   Some systems require unusual options for compilation or linking that
7757171280Schristosthe `configure' script does not know about.  Run `./configure --help'
7857171280Schristosfor details on some of the pertinent environment variables.
791b108b8bSchristos
801b108b8bSchristos   You can give `configure' initial values for configuration parameters
811b108b8bSchristosby setting variables in the command line or in the environment.  Here
821b108b8bSchristosis an example:
831b108b8bSchristos
841b108b8bSchristos     ./configure CC=c99 CFLAGS=-g LIBS=-lposix
851b108b8bSchristos
861b108b8bSchristos   *Note Defining Variables::, for more details.
871b108b8bSchristos
881b108b8bSchristosCompiling For Multiple Architectures
891b108b8bSchristos====================================
901b108b8bSchristos
911b108b8bSchristos   You can compile the package for more than one kind of computer at the
921b108b8bSchristossame time, by placing the object files for each architecture in their
931b108b8bSchristosown directory.  To do this, you can use GNU `make'.  `cd' to the
941b108b8bSchristosdirectory where you want the object files and executables to go and run
951b108b8bSchristosthe `configure' script.  `configure' automatically checks for the
96*2cb32043Schristossource code in the directory that `configure' is in and in `..'.
971b108b8bSchristos
981b108b8bSchristos   With a non-GNU `make', it is safer to compile the package for one
991b108b8bSchristosarchitecture at a time in the source code directory.  After you have
1001b108b8bSchristosinstalled the package for one architecture, use `make distclean' before
1011b108b8bSchristosreconfiguring for another architecture.
1021b108b8bSchristos
10357171280Schristos   On MacOS X 10.5 and later systems, you can create libraries and
10457171280Schristosexecutables that work on multiple system types--known as "fat" or
10557171280Schristos"universal" binaries--by specifying multiple `-arch' options to the
10657171280Schristoscompiler but only a single `-arch' option to the preprocessor.  Like
10757171280Schristosthis:
10857171280Schristos
10957171280Schristos     ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
11057171280Schristos                 CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
11157171280Schristos                 CPP="gcc -E" CXXCPP="g++ -E"
11257171280Schristos
11357171280Schristos   This is not guaranteed to produce working output in all cases, you
11457171280Schristosmay have to build one architecture at a time and combine the results
11557171280Schristosusing the `lipo' tool if you have problems.
11657171280Schristos
1171b108b8bSchristosInstallation Names
1181b108b8bSchristos==================
1191b108b8bSchristos
1201b108b8bSchristos   By default, `make install' installs the package's commands under
1211b108b8bSchristos`/usr/local/bin', include files under `/usr/local/include', etc.  You
1221b108b8bSchristoscan specify an installation prefix other than `/usr/local' by giving
123*2cb32043Schristos`configure' the option `--prefix=PREFIX'.
1241b108b8bSchristos
1251b108b8bSchristos   You can specify separate installation prefixes for
1261b108b8bSchristosarchitecture-specific files and architecture-independent files.  If you
1271b108b8bSchristospass the option `--exec-prefix=PREFIX' to `configure', the package uses
1281b108b8bSchristosPREFIX as the prefix for installing programs and libraries.
1291b108b8bSchristosDocumentation and other data files still use the regular prefix.
1301b108b8bSchristos
1311b108b8bSchristos   In addition, if you use an unusual directory layout you can give
1321b108b8bSchristosoptions like `--bindir=DIR' to specify different values for particular
1331b108b8bSchristoskinds of files.  Run `configure --help' for a list of the directories
134*2cb32043Schristosyou can set and what kinds of files go in them.
1351b108b8bSchristos
1361b108b8bSchristos   If the package supports it, you can cause programs to be installed
1371b108b8bSchristoswith an extra prefix or suffix on their names by giving `configure' the
1381b108b8bSchristosoption `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
1391b108b8bSchristos
140*2cb32043SchristosOptional Features
141*2cb32043Schristos=================
142*2cb32043Schristos
1431b108b8bSchristos   Some packages pay attention to `--enable-FEATURE' options to
1441b108b8bSchristos`configure', where FEATURE indicates an optional part of the package.
1451b108b8bSchristosThey may also pay attention to `--with-PACKAGE' options, where PACKAGE
1461b108b8bSchristosis something like `gnu-as' or `x' (for the X Window System).  The
1471b108b8bSchristos`README' should mention any `--enable-' and `--with-' options that the
1481b108b8bSchristospackage recognizes.
1491b108b8bSchristos
1501b108b8bSchristos   For packages that use the X Window System, `configure' can usually
1511b108b8bSchristosfind the X include and library files automatically, but if it doesn't,
1521b108b8bSchristosyou can use the `configure' options `--x-includes=DIR' and
1531b108b8bSchristos`--x-libraries=DIR' to specify their locations.
1541b108b8bSchristos
15557171280SchristosParticular systems
15657171280Schristos==================
15757171280Schristos
15857171280Schristos   On HP-UX, the default C compiler is not ANSI C compatible.  If GNU
15957171280SchristosCC is not installed, it is recommended to use the following options in
16057171280Schristosorder to use an ANSI C compiler:
16157171280Schristos
16257171280Schristos     ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
16357171280Schristos
16457171280Schristosand if that doesn't work, install pre-built binaries of GCC for HP-UX.
16557171280Schristos
16657171280Schristos   On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
16757171280Schristosparse its `<wchar.h>' header file.  The option `-nodtk' can be used as
16857171280Schristosa workaround.  If GNU CC is not installed, it is therefore recommended
16957171280Schristosto try
17057171280Schristos
17157171280Schristos     ./configure CC="cc"
17257171280Schristos
17357171280Schristosand if that doesn't work, try
17457171280Schristos
17557171280Schristos     ./configure CC="cc -nodtk"
17657171280Schristos
17757171280Schristos   On Solaris, don't put `/usr/ucb' early in your `PATH'.  This
17857171280Schristosdirectory contains several dysfunctional programs; working variants of
17957171280Schristosthese programs are available in `/usr/bin'.  So, if you need `/usr/ucb'
18057171280Schristosin your `PATH', put it _after_ `/usr/bin'.
18157171280Schristos
18257171280Schristos   On Haiku, software installed for all users goes in `/boot/common',
18357171280Schristosnot `/usr/local'.  It is recommended to use the following options:
18457171280Schristos
18557171280Schristos     ./configure --prefix=/boot/common
18657171280Schristos
1871b108b8bSchristosSpecifying the System Type
1881b108b8bSchristos==========================
1891b108b8bSchristos
19057171280Schristos   There may be some features `configure' cannot figure out
19157171280Schristosautomatically, but needs to determine by the type of machine the package
19257171280Schristoswill run on.  Usually, assuming the package is built to be run on the
19357171280Schristos_same_ architectures, `configure' can figure that out, but if it prints
19457171280Schristosa message saying it cannot guess the machine type, give it the
1951b108b8bSchristos`--build=TYPE' option.  TYPE can either be a short name for the system
1961b108b8bSchristostype, such as `sun4', or a canonical name which has the form:
1971b108b8bSchristos
1981b108b8bSchristos     CPU-COMPANY-SYSTEM
1991b108b8bSchristos
2001b108b8bSchristoswhere SYSTEM can have one of these forms:
2011b108b8bSchristos
20257171280Schristos     OS
20357171280Schristos     KERNEL-OS
2041b108b8bSchristos
2051b108b8bSchristos   See the file `config.sub' for the possible values of each field.  If
2061b108b8bSchristos`config.sub' isn't included in this package, then this package doesn't
2071b108b8bSchristosneed to know the machine type.
2081b108b8bSchristos
2091b108b8bSchristos   If you are _building_ compiler tools for cross-compiling, you should
2101b108b8bSchristosuse the option `--target=TYPE' to select the type of system they will
2111b108b8bSchristosproduce code for.
2121b108b8bSchristos
2131b108b8bSchristos   If you want to _use_ a cross compiler, that generates code for a
2141b108b8bSchristosplatform different from the build platform, you should specify the
2151b108b8bSchristos"host" platform (i.e., that on which the generated programs will
2161b108b8bSchristoseventually be run) with `--host=TYPE'.
2171b108b8bSchristos
2181b108b8bSchristosSharing Defaults
2191b108b8bSchristos================
2201b108b8bSchristos
22157171280Schristos   If you want to set default values for `configure' scripts to share,
22257171280Schristosyou can create a site shell script called `config.site' that gives
22357171280Schristosdefault values for variables like `CC', `cache_file', and `prefix'.
2241b108b8bSchristos`configure' looks for `PREFIX/share/config.site' if it exists, then
2251b108b8bSchristos`PREFIX/etc/config.site' if it exists.  Or, you can set the
2261b108b8bSchristos`CONFIG_SITE' environment variable to the location of the site script.
2271b108b8bSchristosA warning: not all `configure' scripts look for a site script.
2281b108b8bSchristos
2291b108b8bSchristosDefining Variables
2301b108b8bSchristos==================
2311b108b8bSchristos
2321b108b8bSchristos   Variables not defined in a site shell script can be set in the
2331b108b8bSchristosenvironment passed to `configure'.  However, some packages may run
2341b108b8bSchristosconfigure again during the build, and the customized values of these
2351b108b8bSchristosvariables may be lost.  In order to avoid this problem, you should set
2361b108b8bSchristosthem in the `configure' command line, using `VAR=value'.  For example:
2371b108b8bSchristos
2381b108b8bSchristos     ./configure CC=/usr/local2/bin/gcc
2391b108b8bSchristos
2401b108b8bSchristoscauses the specified `gcc' to be used as the C compiler (unless it is
2411b108b8bSchristosoverridden in the site shell script).
2421b108b8bSchristos
2431b108b8bSchristosUnfortunately, this technique does not work for `CONFIG_SHELL' due to
2441b108b8bSchristosan Autoconf bug.  Until the bug is fixed you can use this workaround:
2451b108b8bSchristos
2461b108b8bSchristos     CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
2471b108b8bSchristos
2481b108b8bSchristos`configure' Invocation
2491b108b8bSchristos======================
2501b108b8bSchristos
25157171280Schristos   `configure' recognizes the following options to control how it
25257171280Schristosoperates.
2531b108b8bSchristos
2541b108b8bSchristos`--help'
2551b108b8bSchristos`-h'
25657171280Schristos     Print a summary of all of the options to `configure', and exit.
25757171280Schristos
25857171280Schristos`--help=short'
25957171280Schristos`--help=recursive'
26057171280Schristos     Print a summary of the options unique to this package's
26157171280Schristos     `configure', and exit.  The `short' variant lists options used
26257171280Schristos     only in the top level, while the `recursive' variant lists options
26357171280Schristos     also present in any nested packages.
2641b108b8bSchristos
2651b108b8bSchristos`--version'
2661b108b8bSchristos`-V'
2671b108b8bSchristos     Print the version of Autoconf used to generate the `configure'
2681b108b8bSchristos     script, and exit.
2691b108b8bSchristos
2701b108b8bSchristos`--cache-file=FILE'
2711b108b8bSchristos     Enable the cache: use and save the results of the tests in FILE,
2721b108b8bSchristos     traditionally `config.cache'.  FILE defaults to `/dev/null' to
2731b108b8bSchristos     disable caching.
2741b108b8bSchristos
2751b108b8bSchristos`--config-cache'
2761b108b8bSchristos`-C'
2771b108b8bSchristos     Alias for `--cache-file=config.cache'.
2781b108b8bSchristos
2791b108b8bSchristos`--quiet'
2801b108b8bSchristos`--silent'
2811b108b8bSchristos`-q'
2821b108b8bSchristos     Do not print messages saying which checks are being made.  To
2831b108b8bSchristos     suppress all normal output, redirect it to `/dev/null' (any error
2841b108b8bSchristos     messages will still be shown).
2851b108b8bSchristos
2861b108b8bSchristos`--srcdir=DIR'
2871b108b8bSchristos     Look for the package's source code in directory DIR.  Usually
2881b108b8bSchristos     `configure' can determine that directory automatically.
2891b108b8bSchristos
29057171280Schristos`--prefix=DIR'
291*2cb32043Schristos     Use DIR as the installation prefix.  *Note Installation Names::
29257171280Schristos     for more details, including other options available for fine-tuning
29357171280Schristos     the installation locations.
29457171280Schristos
29557171280Schristos`--no-create'
29657171280Schristos`-n'
29757171280Schristos     Run the configure checks, but stop before creating any output
29857171280Schristos     files.
29957171280Schristos
3001b108b8bSchristos`configure' also accepts some other, not widely useful, options.  Run
3011b108b8bSchristos`configure --help' for more details.
3021b108b8bSchristos
303