Install

Download

Tarballs

You can find other releases here (but be aware that they are hidden for a good reason: most of them contain bugs that have been fixed in the next minor release).

Sources

re2c is hosted on github:

$ git clone git@github.com:skvadrik/re2c.git re2c

There’s also a mirror on sourceforge (should be in sync with github):

$ git clone ssh://git.code.sf.net/p/re2c/code-git re2c

Distributions

Linux

Summary of available re2c versions in many (but not all) Linux distributions can be found on pkgs.org.

Build

You only need C++98 compier to build re2c from tarball. If you have bison, re2c will use it (otherwise it will use precompiled files).

If you are building re2c from source (not from tarball), you will also need autotools:

$ ./autogen.sh

Simple

This will install re2c (binary and manpage) to prefix (/usr/local by default):

$ ./configure [--prefix=<prefix>]
$ make
$ make install

Bootstrap

Some parts of re2c (lexers and parser of command-line options) are written in re2c. These files are precompiled and packaged into re2c distribution (so that re2c can be built without re2c). However, one can fully bootstrap re2c:

$ make bootstrap

Out-of-source

re2c supports out-of-source builds:

$ mkdir builddir && cd builddir
$ ../configure [--prefix=<prefix>]
$ make
$ make install

Windows

If you intend to use re2c on Windows, you can either use cygwin or build re2c with mingw:

$ ./configure --host i686-w64-mingw32  [--prefix=<prefix>]
$ make
$ make install

(mingw builds are supported and tested regularly).

Test

re2c has a main test suite and a couple of small tests. Run them all:

$ make check

Or run only the main test suite (and watch progress dumped to stdout):

$ make tests

Run test suite under valgrind (takes a long time):

$ make vtests

Test mingw builds with wine:

$ make wtests

Check the distribution:

$ make distcheck