  	ac_automata_finalize() you can not add new patterns to the automata. */
  } AC_ERROR_t;
  
+diff -ru multifast-v1.0.0/ahocorasick/ahocorasick.c multifast-v1.0.0-patched/ahocorasick/ahocorasick.c
+--- multifast-v1.0.0/ahocorasick/ahocorasick.c	2012-09-02 14:44:23.000000000 -0400
++++ multifast-v1.0.0-patched/ahocorasick/ahocorasick.c	2012-12-06 14:20:38.588344516 -0500
+@@ -326,7 +326,7 @@
+ 		if (m->final)
+ 			node->final = 1;
+ 	}
+-	// TODO : sort matched_patterns? is that necessary? I don't think so.
++	/* TODO : sort matched_patterns? is that necessary? I don't think so. */
+ }
+ 
+ /******************************************************************************

 } AC_TEXT_t;
 
 /* AC_MATCH_t:
@@ -94,7 +94,7 @@
 typedef struct
 {
 	AC_PATTERN_t * patterns; /* Array of matched pattern */
-	long position; /* The end position of matching pattern(s) in the text */
+	ptrdiff_t position; /* The end position of matching pattern(s) in the text */
 	unsigned int match_num; /* Number of matched patterns */
 } AC_MATCH_t;
 
@@ -108,7 +108,7 @@
 	ACERR_DUPLICATE_PATTERN, /* Duplicate patterns */
 	ACERR_LONG_PATTERN, /* Pattern length is longer than AC_PATTRN_MAX_LENGTH */

diff -ru multifast-v1.0.0/ahocorasick/Makefile multifast-v1.0.0-patched/ahocorasick/Makefile
--- multifast-v1.0.0/ahocorasick/Makefile	2012-09-02 19:02:49.000000000 -0400
+++ multifast-v1.0.0-patched/ahocorasick/Makefile	2012-12-06 14:26:39.363963248 -0500
@@ -1,15 +1,33 @@
-LIBNAME := libahocorasick.a
-CFLAGS := -Wall
+PREFIX ?= /usr/local
+INSTALL_INC := $(PREFIX)/include/ahocorasick
+INSTALL_LIB := $(PREFIX)/lib
+
+RANLIB ?= ranlib
+
+LIBNAME ?= libahocorasick.a
+CFLAGS  := --pedantic -fPIC -O2
 HEADERS := actypes.h ahocorasick.h node.h
 
 $(LIBNAME): ahocorasick.o node.o
-	ar -cvq $(LIBNAME) ahocorasick.o node.o
+	$(AR) -cvq $@ $^
+	$(RANLIB) $@
 
 ahocorasick.o: ahocorasick.c $(HEADERS)
-	cc -c ahocorasick.c $(CFLAGS)
+	$(CC) -c $< $(CFLAGS)
 
 node.o: node.c $(HEADERS)
-	cc -c node.c $(CFLAGS)
+	$(CC) -c $< $(CFLAGS)
 
 clean:
-	rm -f ahocorasick.o node.o $(LIBNAME)
+	rm -f -- ahocorasick.o node.o $(LIBNAME)
+
+install: $(LIBNAME) $(HEADERS)
+	cp $(LIBNAME) $(INSTALL_LIB)
+	mkdir -p $(INSTALL_INC)
+	cp $(HEADERS) $(INSTALL_INC)
+
+uninstall:
+	rm -f -- $(INSTALL_LIB)/$(LIBNAME)
+	rm -rf -- $(INSTALL_INC)
+
+.PHONY: clean install uninstall
diff -ru multifast-v1.0.0/ahocorasick/actypes.h multifast-v1.0.0-patched/ahocorasick/actypes.h
--- multifast-v1.0.0/ahocorasick/actypes.h	2012-09-02 15:19:00.000000000 -0400
+++ multifast-v1.0.0-patched/ahocorasick/actypes.h	2012-12-06 14:16:47.818054233 -0500
@@ -61,8 +61,8 @@
 **/
 typedef struct
