2009-09-22 02:38:19 +08:00
|
|
|
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
|
2017-01-17 21:07:16 +08:00
|
|
|
more of the following (note that gettext, OpenSSL, GnuTLS, libidn2,
|
2015-09-04 11:40:21 +08:00
|
|
|
libiconv, libpsl, libpcre, pkg-config, libmetalink and GnuPG are not
|
|
|
|
absolutely required):
|
2009-09-22 02:38:19 +08:00
|
|
|
|
2020-12-28 01:49:03 +08:00
|
|
|
* [20]autoconf (currently, GNU Wget requires version 2.64). This is
|
2009-09-22 02:38:19 +08:00
|
|
|
needed to generate the configure script from configure.in. This is
|
|
|
|
not required when building from a tarball distribution; only when
|
|
|
|
building from repository sources.
|
|
|
|
|
|
|
|
* [21]automake (currently, GNU Wget requires version 1.10.1). This is
|
|
|
|
needed 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.
|
|
|
|
|
|
|
|
* [22]flex is needed to generate the CSS-parsing code.
|
|
|
|
|
|
|
|
* [23]Perl, if you wish 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
|
2015-04-12 00:31:51 +08:00
|
|
|
test suite written in perl and python (see below). To execute all the tests
|
2016-05-24 15:38:15 +08:00
|
|
|
you need libwww-perl and libio-socket-ssl-perl perl library.
|
|
|
|
GNU/Linux distros likely have these two libraries packaged.
|
|
|
|
If not, install them directly with "perl -MCPAN -e 'install Bundle::LWP'"[24].
|
|
|
|
If that fails then you most likely don't have the CPAN module installed.
|
|
|
|
First download [25]CPAN and [26]install it, then try again the above command.
|
2015-01-02 20:47:03 +08:00
|
|
|
Now "make check" should pass most of the tests in the test suite.
|
2009-09-22 02:38:19 +08:00
|
|
|
|
2016-06-10 21:14:43 +08:00
|
|
|
* [45]Python3, if you want to run the tests in the testenv/ subdirectory.
|
|
|
|
Keep in mind that "make check" will try to run all the Perl and Python3
|
2015-04-12 00:31:51 +08:00
|
|
|
tests. More information about the test suite below in the section
|
|
|
|
"Testing and development".
|
|
|
|
|
2009-09-22 02:38:19 +08:00
|
|
|
* [27]texinfo in order 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.
|
|
|
|
|
|
|
|
* [28]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.
|
|
|
|
|
2015-01-02 20:03:44 +08:00
|
|
|
* [29]GnuTLS to allow encrypted data transfer (HTTPS).
|
|
|
|
You need the header files and the library installed.
|
|
|
|
As an alternative, you can use [30]OpenSSL by specifying
|
|
|
|
--with-ssl=openssl to the ./configure script.
|
|
|
|
If you do not want HTTPS support, specify --without-ssl to the
|
|
|
|
./configure script.
|
|
|
|
If you want to compile+link a non-system library version use
|
|
|
|
--with-libgnutls-prefix (or if having pkg-config: see description
|
|
|
|
below).
|
|
|
|
|
2015-01-31 07:32:06 +08:00
|
|
|
* [30]OpenSSL to allow encrypted data transfer (HTTPS) an
|
2015-01-02 20:03:44 +08:00
|
|
|
alternative to [31]GnuTLS.
|
|
|
|
You need the header files and the library installed.
|
|
|
|
If you want to compile+link a non-system library version use
|
|
|
|
--with-libssl-prefix (or if having pkg-config: see description below).
|
|
|
|
|
2017-01-17 21:07:16 +08:00
|
|
|
* [31]libidn2 is required for IDN/IRI support (non-ASCII characters
|
2009-09-22 02:38:19 +08:00
|
|
|
within what would otherwise be URLs).
|
|
|
|
|
2015-01-02 20:03:44 +08:00
|
|
|
* [32]libiconv is required on non-GNU systems, for IDN/IRI support.
|
2009-09-22 02:38:19 +08:00
|
|
|
On GNU systems, the functionality provided by libiconv is already
|
|
|
|
present in the system libraries.
|
|
|
|
|
2021-03-15 02:25:05 +08:00
|
|
|
* [33]git is used to fetch gnulib files through the bootstrap.sh script.
|
2015-01-02 20:03:44 +08:00
|
|
|
|
|
|
|
* [34]libpsl is required for using a public suffix list to check for valid
|
|
|
|
cookie domains. You need the header files and the library installed.
|
|
|
|
|
|
|
|
* [35]libpcre is required for using Perl-compatible regular expressions
|
|
|
|
with --accept-regex and --reject-regex. You need the header files and
|
|
|
|
the library installed to compile and link Wget with PCRE support.
|
|
|
|
|
|
|
|
* [36]pkg-config helps the ./configure script to find installed libraries.
|
|
|
|
Most libraries provide a pkg-config file (.pc extension) with
|
|
|
|
information about dependencies, header file and library locations.
|
|
|
|
Distributions deliver their specific .pc file to each library.
|
|
|
|
If you want to compile+link against your own library version, make a
|
|
|
|
copy of the appropriate .pc file and amend it to your needs (e.g. edit
|
|
|
|
the line starting with prefix=). Before you execute the ./configure
|
|
|
|
script, set (and export) PKG_CONFIG_PATH to the directory where you
|
|
|
|
saved the .pc file. Example:
|
|
|
|
$ PKG_CONFIG_PATH="." ./configure
|
2010-07-12 20:03:18 +08:00
|
|
|
|
2015-09-04 11:40:21 +08:00
|
|
|
* [46]libmetalink is needed to enable Metalink files support.
|
|
|
|
|
|
|
|
* [47]GnuPG with GPGME is used to verify GPG-signed Metalink resources.
|
|
|
|
|
2016-03-20 20:42:47 +08:00
|
|
|
* [48]libcares is needed to bind DNS resolving to a given IP address.
|
|
|
|
The command line options --dns-servers and --bind-dns-address are
|
|
|
|
only available when configured with --with-cares.
|
2014-05-31 00:40:12 +08:00
|
|
|
|
2020-03-06 04:06:42 +08:00
|
|
|
* [49]gperf is required by some gnulib modules, most notably "unicase". You
|
|
|
|
need the application installed on the machine to compile Wget from git.
|
2017-07-31 20:56:32 +08:00
|
|
|
|
|
|
|
|
2009-09-22 02:38:19 +08:00
|
|
|
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
|
2014-11-04 18:51:09 +08:00
|
|
|
that point, a shell script called bootstrap has been provided. After
|
|
|
|
calling ./bootstrap you're ready to build GNU Wget in the normal
|
2009-09-22 02:38:19 +08:00
|
|
|
fashion, with ./configure and make.
|
|
|
|
|
|
|
|
So, to sum up, after checking out the source code as described above,
|
|
|
|
you may proceed as follows:
|
|
|
|
1. Change to the topmost GNU Wget directory:
|
|
|
|
$ cd wget # assumes you've cloned a repository to "./wget"
|
|
|
|
2. Generate all the automatically-generated files required prior to
|
|
|
|
configuring the package:
|
2017-04-18 16:47:15 +08:00
|
|
|
$ ./bootstrap (or: bash ./bootstrap)
|
2009-09-22 02:38:19 +08:00
|
|
|
3. Configure the package and compile it:
|
2014-11-20 22:25:51 +08:00
|
|
|
$ ./configure --enable-assert [some_parameters]
|
2009-09-22 02:38:19 +08:00
|
|
|
$ make
|
|
|
|
4. Hack, compile, test, hack, compile, test...
|
|
|
|
$ src/wget --version
|
|
|
|
GNU Wget 1.12-devel (9cb2563197bc)
|
|
|
|
|
2015-04-12 00:31:51 +08:00
|
|
|
Testing and development
|
|
|
|
|
2014-11-20 22:25:51 +08:00
|
|
|
All developers are requested to enable the assertions on their development
|
|
|
|
builds to ensure a stable codebase. Assertions are added to state certain
|
|
|
|
assumptions about the code and its data which all developers should be mindful
|
|
|
|
of. To enable assertions, run the configure command with the --enable-assert
|
|
|
|
option, like this:
|
|
|
|
|
|
|
|
$ ./configure --enable-assert [other configure options]
|
|
|
|
|
2015-04-12 00:31:51 +08:00
|
|
|
Both the Perl and Python test suites (test/ and testenv/) include support for GDB and Valgrind.
|
|
|
|
The environment variables GDB_TESTS and VALGRIND_TESTS are available to
|
|
|
|
enable such wrappers. If specified, Wget would be run through either of them
|
|
|
|
during the test. For example:
|
|
|
|
|
|
|
|
$ cd testenv
|
|
|
|
$ VALGRIND_TESTS=1 ./Test-O.py
|
|
|
|
|
|
|
|
That would execute Test-O.py test case, but running Wget through Valgrind.
|
|
|
|
|
|
|
|
GDB has preference over Valgrind. If both variables have been asserted,
|
|
|
|
Wget would be run through GDB.
|
|
|
|
|
|
|
|
If you run a test case through GDB, please bear in mind that it could give
|
|
|
|
a false negative. This is because some tests that expect Wget to fail
|
|
|
|
rely on Wget's return code. However, when run through GDB, its return code
|
|
|
|
will always be zero, causing the test to claim failure. This wrapper for
|
|
|
|
GDB is, however, very useful to tackle bugs, allowing one to write a test case
|
|
|
|
for some specific bug and then using GDB to fix it more easily. Otherwise,
|
|
|
|
a dedicated server would have to be set up and write a custom CGI just to reproduce
|
|
|
|
that bug, which might be tedious. Tests should only be run through GDB for that purpose.
|
|
|
|
|
|
|
|
|
2023-02-13 01:54:52 +08:00
|
|
|
Copyright (C) 2008, 2010, 2014-2015, 2018-2023 Free Software
|
2019-02-10 18:29:48 +08:00
|
|
|
Foundation, Inc.
|
2009-09-22 02:38:19 +08:00
|
|
|
License GPLv3+: GNU GPL version 3 or later
|
2017-01-17 21:25:15 +08:00
|
|
|
<https://www.gnu.org/licenses/gpl.html>.
|
2009-09-22 02:38:19 +08:00
|
|
|
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>.
|
|
|
|
|
2014-05-31 00:40:12 +08:00
|
|
|
* [36]Edit
|
|
|
|
* [37]Comments
|
|
|
|
* [38]Info
|
|
|
|
* [39]Attachments
|
2009-09-22 02:38:19 +08:00
|
|
|
* More Actions:
|
|
|
|
[Raw Text................] Do
|
|
|
|
|
2014-05-31 00:40:12 +08:00
|
|
|
* [40]MoinMoin Powered
|
|
|
|
* [41]Python Powered
|
|
|
|
* [42]GPL licensed
|
|
|
|
* [43]Valid HTML 4.01
|
2009-09-22 02:38:19 +08:00
|
|
|
__________________________________________________________________
|
|
|
|
|
2015-01-02 20:03:44 +08:00
|
|
|
All content (C) 2007 Free Software Foundation. For terms of use,
|
|
|
|
redistribution, and modification, please see the [45]WikiLicense page.
|
2009-09-22 02:38:19 +08:00
|
|
|
|
|
|
|
References
|
|
|
|
|
2017-01-17 21:25:15 +08:00
|
|
|
20. https://www.gnu.org/software/autoconf/
|
|
|
|
21. https://www.gnu.org/software/automake/
|
|
|
|
22. https://github.com/westes/flex
|
|
|
|
23. https://www.perl.org/
|
2009-09-22 02:38:19 +08:00
|
|
|
24. http://search.cpan.org/dist/libwww-perl/lib/Bundle/LWP.pm
|
|
|
|
25. http://search.cpan.org/CPAN/authors/id/A/AN/ANDK/CPAN-1.9402.tar.gz
|
|
|
|
26. http://apthorpe.cynistar.net/code/configuring_cpan.html
|
2017-01-17 21:25:15 +08:00
|
|
|
27. https://www.gnu.org/software/texinfo/
|
|
|
|
28. https://www.gnu.org/software/gettext/
|
|
|
|
29. https://www.gnu.org/software/gnutls/
|
|
|
|
30. https://www.openssl.org/
|
|
|
|
31. https://www.gnu.org/software/libidn/#libidn2
|
|
|
|
32. https://www.gnu.org/software/libiconv/
|
|
|
|
33. https://git-scm.com/
|
2015-01-02 20:03:44 +08:00
|
|
|
34. https://github.com/rockdaboot/libpsl
|
2018-01-14 18:15:32 +08:00
|
|
|
35. https://www.pcre.org
|
2014-05-31 00:40:12 +08:00
|
|
|
36. http://wget.addictivecode.org/CompilingRepoSources?action=edit&editor=text
|
|
|
|
37. http://wget.addictivecode.org/CompilingRepoSources
|
|
|
|
38. http://wget.addictivecode.org/CompilingRepoSources?action=info
|
|
|
|
39. http://wget.addictivecode.org/CompilingRepoSources?action=AttachFile
|
2017-01-17 21:25:15 +08:00
|
|
|
40. https://moinmo.in/
|
|
|
|
41. https://moinmo.in/Python
|
|
|
|
42. https://moinmo.in/GPL
|
|
|
|
43. https://validator.w3.org/check?uri=referer
|
2014-05-31 00:40:12 +08:00
|
|
|
44. http://wget.addictivecode.org/WikiLicense
|
2015-04-12 00:31:51 +08:00
|
|
|
45. https://www.python.org/
|
2015-09-04 11:40:21 +08:00
|
|
|
46. https://launchpad.net/libmetalink
|
|
|
|
47. https://www.gnupg.org
|
2017-01-17 21:25:15 +08:00
|
|
|
48. https://c-ares.haxx.se/
|
2017-07-31 20:56:32 +08:00
|
|
|
49. https://www.gnu.org/software/gperf/
|