Compiling From Repository Sources
To reduce bandwidth and needless updates, the source code repository does not contain automatically-generated files, even when these are normally present in the distribution tarballs. Therefore, to build GNU Wget from the sources in the repository, you'll need to have one or more of the following (note that gettext, OpenSSL, libidn and libiconv are not absolutely required):
autoconf (currently, GNU Wget requires version 2.61) to generate the configure script from configure.in. This is not required when building from a tarball distribution; only when building from repository sources.
automake (currently, GNU Wget requires version 1.10.1) for generating the Makefile.in templates that the configure script uses to generate the Makefiles. As with autoconf, it is not required when building from a tarball distribution; only when building from repository sources.
flex to generate the CSS-parsing code.
Perl, to generate the wget(1) manpage, or run the tests in the tests/ sub directory. Tarball distributions include an already-generated wget.1 manual. The command "make check" runs the test suite written in perl. To execute all the tests you need libwww-perl perl library. If "perl -MCPAN -e 'install Bundle::LWP'" fails then you most likely don't have cpan module installed. First download CPAN and install it. Then execute "perl -MCPAN -e 'install Bundle::LWP'". Now "make check" should pass most of the tests in the test suite.
texinfo to generate Info, PostScript and/or HTML documentation. You don't need texinfo in order to generate the wget(1) manpage; however, note that the manpage does not include the full documentation. Tarball distributions include the already-generated documentation in these formats.
gettext, if you wish to compile with NLS (Native Language Support), which is enabled by default. If you do not have gettext, you can compile without it by specifying --disable-nls to the ./configure script. This is true regardless of where you obtained the source you're building. NOTE: if you get errors about AM_GNU_GETTEXT and/or AM_INTL_SUBDIR, you probably have a buggy version of GNU m4. Upgrade to the latest version. You may also need to export M4=<new m4 path>, to be sure that autoconf/automake use it instead of the old one.
- to handle encrypted web sessions (https, you almost certainly want this), you need either:
OpenSSL It is not enough to have the library installed; you need to have the header files available to compile against as well. For GNU/Linux systems, this usually means installing a "developer" package for openssl (for example, Debian systems require installation of the libssl-dev package).
GNUTLS library. This is the default SSL backend.
If you don't want to build Wget with ssl support, specify --without-ssl to the ./configure script.
libidn for IDN/IRI support (non-ASCII characters within what would otherwise be URLs).
libiconv for IDN/IRI support on non-GNU systems. On GNU systems, the functionality provided by libiconv is already present in the system libraries.
For those who might be confused as to what to do once they check out the source code, considering configure and Makefile do not yet exist at that point, a shell script called bootstrap has been provided. After calling ./bootstrap you're ready to build GNU Wget in the normal fashion, with ./configure and make.
So, to sum up, after checking out the source code as described above, you may proceed as follows:
- Change to the topmost GNU Wget directory:
$ cd wget # assumes you've cloned a repository to "./wget"
- Generate all the automatically-generated files required prior to configuring the package:
$ ./bootstrap
- Configure the package and compile it:
$ ./configure [some_parameters] $ make
- Hack, compile, test, hack, compile, test...
$ src/wget --version GNU Wget 1.15.27-86245 built on linux-gnu. +digest +https +ipv6 +iri +large-file +nls +ntlm +opie +ssl/gnutls Wgetrc: /usr/local/etc/wgetrc (system) Locale: /usr/local/share/locale Compile: gcc -DHAVE_CONFIG_H -DSYSTEM_WGETRC="/usr/local/etc/wgetrc" -DLOCALEDIR="/usr/local/share/locale" -I. -I../lib -I../lib -O2 -Wall Link: gcc -O2 -Wall -lnettle -lgnutls -lz -lidn -luuid -lpcre ftp-opie.o gnutls.o http-ntlm.o ../lib/libgnu.a Copyright (C) 2014 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://www.gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Originally written by Hrvoje Niksic <hniksic@xemacs.org>. Please send bug reports and questions to <bug-wget@gnu.org>.