diff --git a/trunk/ann/Makefile b/trunk/ann/Makefile
index c7a85f382a87bf83cb16d36c2a515c28b315ec79..17a131efc7443e113a51d78b6ad56863179901b6 100644
--- a/trunk/ann/Makefile
+++ b/trunk/ann/Makefile
@@ -5,7 +5,7 @@ all: installed
 #
 TARBALL = build/ann_1.1.2.tar.gz
 TARBALL_URL = http://www.cs.umd.edu/~mount/ANN/Files/1.1.2/ann_1.1.2.tar.gz
-TARBALL_PATCH = fPIC.diff
+TARBALL_PATCH = fANN.diff
 INITIAL_DIR = build/ann_1.1.2
 SOURCE_DIR = build/ann-tar
 include $(shell rospack find mk)/download_unpack_build.mk
diff --git a/trunk/ann/fANN.diff b/trunk/ann/fANN.diff
new file mode 100644
index 0000000000000000000000000000000000000000..6c7650f3e8501faf8ac77151ce3218f5fb232a23
--- /dev/null
+++ b/trunk/ann/fANN.diff
@@ -0,0 +1,24 @@
+diff -purN ann_1.1.2/include/ANN/ANN.h ann_1.1.2_modified/include/ANN/ANN.h
+--- include/ANN/ANN.h	2010-01-27 20:40:01.000000000 -0800
++++ include/ANN/ANN.h	2011-08-30 12:13:26.629632052 -0700
+@@ -232,7 +232,7 @@ const ANNdist	ANN_DIST_INF = ANN_DBL_MAX
+ //	strictly positive.
+ //----------------------------------------------------------------------
+ 
+-const ANNbool	ANN_ALLOW_SELF_MATCH	= ANNtrue;
++const ANNbool	ANN_ALLOW_SELF_MATCH	= ANNfalse;
+ 
+ //----------------------------------------------------------------------
+ //	Norms and metrics:
+diff -purN ann_1.1.2/Make-config ann_1.1.2_modified/Make-config
+--- Make-config	2010-01-27 20:40:01.000000000 -0800
++++ Make-config	2011-08-30 12:12:42.916876291 -0700
+@@ -72,7 +72,7 @@ linux-g++:
+ 	$(MAKE) targets \
+ 	"ANNLIB = libANN.a" \
+ 	"C++ = g++" \
+-	"CFLAGS = -O3" \
++	"CFLAGS = -O3 -fPIC" \
+ 	"MAKELIB = ar ruv" \
+ 	"RANLIB = true"
+