|Version 15 (modified by bjorn, 4 years ago) (diff)|
Installing Varnish from source code
The following tools are required to build Varnish:
- A recent version of GCC (3.3.x or newer should be fine, 4.2.1 or newer recommended)
- A POSIX-compatible make (GNU make is fine)
- Recent versions of the GNU autotools ( automake, autoconf, libtool and ncurses)
- When building source code checked out from the repository (as opposed to source code from a release tarball), you will also need xsltproc from libxslt.
Obtaining the source code
OS specific prerequisites
Various Linux distributions
- Installing Varnish on Gentoo Linux
- Installing Varnish on Redhat Enterprise Linux / Centos
- Installing Varnish on Debian GNU/Linux and Ubuntu Linux
- Installing Varnish on SuSE Linux (SLES and OpenSuSE)
Mac OS X
- Install automake, i.e. via Darwin Ports: sudo port install automake as the version of automake that ships with OS X is too old.
- Make sure /opt/local/bin/automake is in your PATH when running autogen.sh:
$ PATH=/opt/local/bin/automake:$PATH ./autogen.sh
- Make sure your ports tree is up to date, or you may run into trouble with the GNU autotools.
- Install devel/automake19 (or newer) from the ports collection. This will automatically pull in an appropriate version of autoconf.
- Install devel/libtool15 (or newer) from the ports collection.
- Optionally install textproc/libxslt from the ports collection if you need xsltproc (see above).
Configuring and building
You will first need to generate the configure script:
You may see some error messages. Check if configure and Makefile.in were generated. If they weren't, you probably need newer versions of the GNU autotools. If they were; run autogen.sh again: any error messages it still shows the second time around are most likely caused by bugs in autoconf macros installed by other software you have on your machine, and can safely be ignored.
Next, run configure. In most cases, the defaults are correct and you do not need to specify any command-line options, except perhaps --prefix. If you plan on hacking the Varnish sources, however, you will most likely want to turn on stricter error checks and dependency tracking:
$ ./configure --enable-debugging-symbols --enable-developer-warnings --enable-dependency-tracking
If you have gcc 4.2.0 or newer, add --enable-extra-warnings to get additional compile-time warnings.
If you have a version of gcc with stack protection, add --enable-stack-protector to enable run-time stack smashing detection.
If you're trying to track down an elusive bug or a race condition, --enable-diagnostics may help, but it will reduce performance and increase the amount of log data generated.
If configure completes without any errors, simply run make to compile Varnish and make install to install it. You can also run make check to test your build.