source: trunk/essentials/net-misc/wget/INSTALL@ 3453

Last change on this file since 3453 was 3440, checked in by bird, 18 years ago

wget 1.10.2

File size: 8.4 KB
Line 
1 -*- text -*-
2 GNU Wget Installation Procedure
3 ===============================
4
50. Introduction
6---------------
7
8This document describes how to build Wget from source code on
9Unix-like systems. If you want to install a precompiled Wget, this
10document is not for you -- refer to the documentation provided by the
11distributors instead. If you already have Wget and want to learn how
12to use it, refer to Wget's Info documentation or man page which you
13should have received with your system. If you are using Windows
14(except for Cygwin), read windows/README instead. If you want to
15compile Wget from source code on a Unix-like system, read on.
16
17The preferred form of building Wget is to get a release archive and
18unpack it (which you have presumably done, since you are reading
19this). If you have obtained the source code via the Subversion
20repository, please follow the instructions in `README.checkout' before
21continuing.
22
231. Dependencies
24---------------
25
26To build Wget, your system must support a Unix-like command-line
27development environment, including the text-processing utilities (sh,
28grep, awk, sed, etc.) and a functional C compiler. On some GNU/Linux
29systems, this means that you will need to install packages such as
30`gcc', `glibc-devel' (or `libc6-dev') and `make'. Most systems come
31with these packages preinstalled, but it doesn't hurt to check. If
32you have successfully compiled other software from source, you
33probably have them all.
34
35In addition to the C development environment, Wget can use a number of
36optional libraries to provide additional features, such as translated
37messages and support for "https" URLs. The "external" dependencies
38include:
39
40 - OpenSSL -- for "https" URLs.
41 - GNU gettext -- for translated messages.
42
43To be usable for building Wget, the listed libraries must be installed
44with their "development" header files. On GNU/Linux systems this
45typically means installing the corredponsing "lib<name>-devel" or
46"lib<name>-dev" package along with the package with "lib<name>".
47
482. Configuration
49----------------
50
51Before compiling Wget, you need to "configure" it using the
52`configure' script provided with the distribution. Configuration
53serves two distinct purposes: it enables Wget's build system to
54inspect certain features of your operating system for more robust
55compilation, and it enables you to choose which features you want the
56resulting Wget to have.
57
58As is the case with most GNU software, Wget's configure script was
59generated with GNU Autoconf. If you're not familiar with
60Autoconf-generated scripts, read on.
61
62The most straightforward way to configure Wget is by running the
63configure script without any arguments. After running some
64compilation-related tests, it will create the Makefiles needed to
65build Wget. However, you may wish to customize Wget's configuration
66by providing arguments to `configure'. Wget's configure script
67accepts standard Autoconf arguments, the most important ones being:
68
69 --help display a help message and exit
70
71 --prefix=PREFIX install architecture-independent files in PREFIX
72 (/usr/local by default)
73 --bindir=DIR user executables in DIR (PREFIX/bin)
74 --infodir=DIR info documentation in DIR [PREFIX/info]
75 --mandir=DIR man documentation in DIR [PREFIX/man]
76
77For example, if you are not root and want to install Wget in
78subdirectories of your home directory, you can use:
79
80 ./configure --prefix=$HOME
81
82In addition to the above generic options, Wget's configuration
83supports a number of options more or less specific to Wget. Options
84beginning with "--disable", such as `--disable-opie' or
85`--disable-ntlm', allow you to turn off certain built-in functionality
86you don't need in order to reduce the size of the executable. Options
87beginning with "--with" turning off autodetection and use of external
88software Wget can link with, such as the SSL libraries. Recognized
89"--enable" and "--with" options include:
90
91 --without-ssl disable SSL autodetection (used for https support)
92 --with-libssl-prefix=DIR search for libssl in DIR/lib
93 --disable-opie disable support for opie or s/key FTP login
94 --disable-digest disable support for HTTP digest authorization
95 --disable-ntlm disable support for HTTP NTLM authorization
96 --disable-debug disable support for debugging output
97 --disable-nls do not use Native Language Support
98 --disable-largefile omit support for large files
99 --disable-ipv6 disable IPv6 support
100 --disable-rpath do not hardcode runtime library paths
101
102You can inspect decisions made by configure by editing the generated
103Makefiles and the `src/config.h' include file. The defaults should
104work without intervention, but if you know what you are doing, editing
105the generated files before compilation is fine -- they will not be
106regenerated until you run configure again.
107
108`configure' will try to find a compiler in your PATH, defaulting to
109`gcc', but falling back to `cc' if the former is unavailable. This is
110a reasonable default on most Unix-like systems, but sometimes you
111might want to override it. The compiler choice is overridden by
112setting the `CC' environment variable to the desired compiler file
113name. For example, to force compilation with the Unix `cc' compiler,
114invoke configure like this:
115
116 ./configure CC=cc
117
118This assumes that `cc' is in your path -- if it is not, simply use
119CC=/path/to/cc instead. Note that environment variables that affect
120configure can be set with the usual shell syntax `VAR=value
121./configure' (assuming sh syntax), but can also be specified as
122arguments to configure, as shown above. The latter method, while
123being specific to configure, works unmodified in all shells.
124
125Environment variables that affect `configure' include: CFLAGS for C
126compiler flags, CPPFLAGS for C preprocessor flags, LDFLAGS for linker
127flags, and LIBS for libraries.
128
129Barring the use of --without-* flags, configure will try to autodetect
130external libraries needed by Wget, currently only the OpenSSL
131libraries. If they are installed in the system library directories or
132in the same prefix where you plan to install Wget, configure should be
133able to autodetect them. If they are installed elsewhere, use the
134`--with-libNAME' option to specify the root directory under which
135libraries reside in the `lib/' subdirectory and the corresponding
136header files reside in the `include/' subdirectory. For example, if
137the OpenSSL libraries are installed under the /usr/local/ssl prefix,
138use `--with-libssl=/usr/local/ssl'.
139
140Sometimes external libraries will be installed on the system, but the
141header files will be missing. This often happens on GNU/Linux if you
142forget to install the "-devel" or "-dev" package that corresponds to
143the library and that is typically *not* installed by default. In that
144case configure will not find the library and you will not be able to
145use the features provided by the library until you install the devel
146package and rerun configure. If you believe you have the necessary
147headers, but configure still fails to detect the library, please
148report it as a bug.
149
1503. Compilation
151--------------
152
153To compile GNU Wget after it has been configured, simply type make.
154If your compiler is too old to handle function prototypes, Wget will
155try to K&R-ize its sources on the fly. This should make GNU Wget
156compilable on almost any Unix-like system you are likely to encounter.
157
158After the compilation a ready-to-use `wget' executable should reside
159in the src directory. At this point there is no formal test suite for
160testing the binary, but it should be easy enough to test whether the
161basic functionality works.
162
1634. Installation
164---------------
165
166Use `make install' to install GNU Wget to directories specified to
167configure. To install it in a system directory (which is the
168default), you will need to be root. The standard prefix is
169"/usr/local/", which can be changed using the `--prefix' configure
170option.
171
172The installation process will copy the wget binary to $PREFIX/bin,
173install the wget.info* info pages to $PREFIX/info, the generated
174manual page (where available) wget.1 to $PREFIX/man/man1, and the
175default config file to $PREFIX/etc, unless a config file already
176exists there. You can customize these directories either through the
177configuration process or making the necessary changes in the Makefile.
178
179To delete the files created by Wget installation, you can use `make
180uninstall'.
Note: See TracBrowser for help on using the repository browser.