Building CRM114 with TRE On MacOS X Tiger
Tagged:  •  

Warning: this information was written on June 7th, 2005, and works for the BlameMercury build of CRM114. I have tested it on MacOS 10.3.9 (Panther) and MacOS 10.4.1 (Tiger). Your mileage may vary!

You can download a source distribution from http://crm114.sourceforge.net.

If you are building for another platform, I'd suggest that you uncompress the distribution and then follow the build instructions in the CRM114_Mailfilter_HOWTO.txt file.

However, if like me you are using MacOS X, you need to perform one extra step, and modify a Makefile slightly. Without this, you will get a link error saying "can't locate file for: -lcrt0.o".

Once you've downloaded and uncompressed the source, open the folder and edit the Makefile file.

Search for a line:

LDFLAGS += -static

and comment it out by placing a # character before it:

#LDFLAGS += -static

You can now proceed with the instructions in CRM114_Mailfilter_HOWTO.txt. I've reproduced a simplified version of these below (I've removed some options, so for a fuller description read the original file):

Open a terminal window and cd into the crm114- directory. You will see many files
here.

To install TRE, type this (don't forget to tell
configure to "--enable-static" ) :


cd crm114-

cd tre-

sudo ./configure --enable-static

sudo make

sudo make install

You have now installed the TRE regex library as /usr/local/lib/libtre .

Once TRE is built and installed you can compile CRM114 and the
accompanying utilities (cssutil, cssdiff, and cssmerge). By default,
CRM114 installs into /usr/bin (_not_ /usr/local/bin - if you want to
change this, change the definition of INSTALL_DIR near the top of the
file "Makefile").

Change directory back up to the CRM114 directory,
then (noting that no .configure step is necessary) type:


cd ..

sudo make clean

sudo make install

This will compile, link, install, and strip the executables (stripping
gets rid of unnecessary debugging information and makes the executables
load faster and use less memory).

You can test your installation of CRM114. Just type:


crm -v

and CRM114 will report back the version of the install.

You can also run a quick "Hello, world!" by typing:


crm '-{ output /Hello, world! This is CRM114 version :*:_crm_version: .\n/}'

then hit ^D (end-of-file on *nix). You;ll get back a response like:

Hello, world! This is CRM114 version 20040118-BlameEric .