Linux HOWTOs

About | Home | Search

HOWTO: re2c
Description: Tool for writing very fast and flexible scanners
Click here for ChangeLog
NOTE: I use GNU tar >= 1.13.25 so it's -j for .tar.bz2 files,
it's safe to assume that make, gcc, binutils, fileutils/coreutils, gawk, sed, and grep are prerequisites for almost everything

# re2c 0.16
# =========
# Prerequisites:
# bison

# Get it or re-use the tarball if you already have it
test -f installed/re2c-0.16.tar.gz && mv installed/re2c-0.16.tar.gz .
test ! -f re2c-0.16.tar.gz &&

# Extract it
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "re2c-*" -exec rm -r {} \;
tar xzvf ~/re2c-0.16.tar.gz
cd re2c-0.16
test $UID = 0 && chown -R root:root .

# Configure the build
./configure --prefix=/usr --sysconfdir=/etc --mandir=/usr/man

# Build it

# Become root to install it

# Install it
make install

# Make sure your non-root user can remove the source later
chown -R $(logname) .
chmod -R u+w .

# Become your non-root user again

# Save the tarball for later
mkdir -p -m 0700 installed
rm -f installed/re2c-*.tar.*
mv re2c-0.16.tar.gz installed/

# If you ever want to uninstall re2c, this should do it:
test -d src/re2c-* && ( cd src/re2c-* ; make uninstall )
rm -f /usr/bin/re2c /usr/man/man1/re2c.1
find ~/src -maxdepth 1 -type d -name "re2c-*" -exec rm -r {} \;
rm -f ~/installed/re2c-*.tar.*

Back to the list

Last updated: Tue, 07 Aug 2018 12:06:17 -0400
Jason Englander <jason at englanders dot us>