Compiling flexc++ from source (in Ubuntu Precise)

February 2012


[Note]Note

As of this writing, flexc++ has been out less than a week. So you may want to try just installing it with the package management system, instead of rushing in an following the steps below.

[Note]Note

This section is already outdated. Flexc++ is available from Debian Sid, and the Sid package can be installed in Precise.

Procedure 22.  BobCat

  1. Fetch

    Flexc++ won't compile with the BobCat that comes with Precise. So we fetch its latest version

  2. Installing some necessary packages

    apprentice@testbox:~$ sudo apt-get install -y icmake libreadline-dev libx11-dev libssl-dev

  3. Untarring

    tar zxf bobcat_2.21.01.orig.tar.gz
    cd bobcat-2.21.01

  4. Editing INSTALL.im

    The file INSTALL.im contains the install path /usr. Change it to /usr/local like this:

    <snip>
    void setLocations()
    {
    BASE  = "/usr/local";
    <snip>
    	

  5. Building

    apprentice@testbox:~$ ./build libraries
    The class FBB::Xpointer can only be compiled if you have installed
    the file X11/Xlib.h. To use the class Xpointer, programs using Xpointer
    objects must also be linked against the X11 library: -lX11 -lbobcat

    The class FBB::Xpointer can safely be left out of the bobcat library if
    you're not planning to construct programs using Xpointer.

    Press Enter y if you WANT to compile the files of the class FBB::Xpointer.
    Press Enter or any other line if you DON'T WANT to include the class
                                  FBB::Xpointer in the bobcat library.
    y
    The SSL classes can only be compiled if you have installed
    the libssl-dev development library, containing files like
    /usr/include/openssl/bn.h. To use objects from openssl programs
     must also be linked against the openSSL library: -lssl -lbobcat

    The SSL classes can safely be left out of the bobcat library if
    you're not planning to construct programs using them.

    Press Enter y if you WANT to compile the files of the SSL classes
    Press Enter or any other line if you DON'T WANT to include the SSL classes
                                  in the bobcat library.
    y
    The classes using the readline library can only be compiled if you
    have installed the libreadline-dev development library, containing
    files like /usr/include/readline.h. To use objects of these
    classes in your programs, your programs must also be linked
    against the readline library: -lreadline -lbobcat

    The classes depending on the readline library can safely be left
    out of the bobcat library if you're not planning to construct
    programs using them.

    Press Enter y if you WANT to compile the classes using the
    readline library
    Press Enter or any other line if you DON'T WANT to include these     classes in the bobcat library.
    y
    The class FBB::Milter can only be compiled if you have installed
    the file libmilter/mfapi.h. To use the class Milter, programs using
    Milter objects must also be linked against the milter library:
    -lmilter -lbobcat

    The class FBB::Milter can safely be left out of the bobcat library if
    you're not planning to construct mail filters using FBB::Milter.

    Press Enter y if you WANT to compile the files of the class FBB::Milter.
    Press Enter or any other line if you DON'T WANT to include the class
                                  FBB::Milter in the bobcat library.
    n
    <snip>

  6. Installing

    apprentice@testbox:~$ sudo ./build install

Procedure 23.  Flexc++

  1. Fetching

    apprentice@testbox:~$ wget https://www.icce.rug.nl/debian/flexc++/flexc++_0.09.51.tar.gz
    apprentice@testbox:~$ tar zxf flexc++_0.09.51.tar.gz
    apprentice@testbox:~$ cd flexc++-0.09.51

  2. Edit INSTALL.im

    Make it install in /usr/local by setting that path in INSTALL.im:

    <snip>
    void setLocations()
    {
    BASE  = "/usr/local"
    <snip>

  3. Build

    apprentice@testbox:~$ ./build program

  4. Install

    apprentice@testbox:~$ sudo ./build install