Index: doc/ChangeLog
===================================================================
--- doc/ChangeLog	(revision 46df1bccf39ae760708f33fb41ec1819bdc1fde2)
+++ doc/ChangeLog	(revision 4f40c3e6cf53f7c95a2a544455682c85f601e846)
@@ -2,5 +2,5 @@
 
     2013-01-XX
-	* Patched Yap 6.2.3 to run on FreeBSD9.1
+	* Patched Yap to run on FreeBSD9.1
         * Added a configuration check for thread linked perl 
         * Added option to disable the generation of swig/java directory
Index: doc/INSTALL
===================================================================
--- doc/INSTALL	(revision 46df1bccf39ae760708f33fb41ec1819bdc1fde2)
+++ doc/INSTALL	(revision 4f40c3e6cf53f7c95a2a544455682c85f601e846)
@@ -6,6 +6,10 @@
    Please check doc/dependencies for other software dependencies
 
-Download yap-6.2.3 from www.dcc.fc.up.pt
-   http://www.dcc.fc.up.pt/~vsc/Yap/yap-6.2.3.tar.gz
+Download yap-6.2.2 from www.dcc.fc.up.pt
+   http://www.dcc.fc.up.pt/~vsc/Yap/yap-6.2.2.tar.gz
+
+   $patch --verbose -p0 -i yap6_2_2_patch_1
+   (Patching for FreeBSD or 64bits machines, patch file can be 
+   found in libABAC's doc directory)
 
    $./configure --enable-dynamic-loading --enable-use-malloc=yes
@@ -35,10 +39,10 @@
        --with-ipseclibdir and --with-plugindir are set otherwise.
 
-   $ tar xjvf strongswan-4.6.4.tar.bz2
-   $ cd strongswan-4.6.4
-   $ # see note above about configure flags
-   $ ./configure --enable-monolithic 
-   $ cd src/libstrongswan
-   $ make && sudo make install
+   $tar xjvf strongswan-4.6.4.tar.bz2
+   $cd strongswan-4.6.4
+   $# see note above about configure flags
+   $./configure --enable-monolithic 
+   $cd src/libstrongswan
+   $make && sudo make install
    
    Be sure to make note of the directory into which you've untarred
@@ -48,14 +52,14 @@
 
    FreeBSD users will need to install flex-2.5.35 or greater from 
-   ports and use 
+   ports and add 
    --with-flex=/usr/local/bin/flex --with-extra-includes=/usr/local/include
-   on ./configure in addition to --with-strongswan
+   on ./configure line in addition to --with-strongswan=...
 
-   $ STRONGSWAN_SRC_DIR=path/to/strongswan-4.6.4
-   $ STRONGSWAN_LIB_DIR=/usr/local/lib/ipsec
-   $ ./configure --with-strongswan=$STRONGSWAN_SRC_DIR 
+   $STRONGSWAN_SRC_DIR=path/to/strongswan-4.6.4
+   $STRONGSWAN_LIB_DIR=/usr/local/lib/ipsec
+   $./configure --with-strongswan=$STRONGSWAN_SRC_DIR 
                  --with-strongswan-ld-path=$STRONSWAN_LIB_DIR
-   $ make 
-   $ sudo make install
+   $make 
+   $sudo make install
 
 
Index: doc/dependencies
===================================================================
--- doc/dependencies	(revision 46df1bccf39ae760708f33fb41ec1819bdc1fde2)
+++ doc/dependencies	(revision 4f40c3e6cf53f7c95a2a544455682c85f601e846)
@@ -26,6 +26,6 @@
     readline-6.2
 
-YAP 6.2.3 Prolog system:
-    http://www.dcc.fc.up.pt/~vsc/Yap/yap-6.2.3.tar.gz
+YAP 6.2.2 Prolog system:
+    http://www.dcc.fc.up.pt/~vsc/Yap/yap-6.2.2.tar.gz
     (configure with --enable-dynamic-loading --enable-use-malloc=yes) 
 
@@ -39,5 +39,5 @@
 
 The following is a complete list of packages required in order to build from
-git on Ubuntu (tested on version 10.04):
+git on Ubuntu (tested on version 10.04,11.04,12.04):
 
 autoconf-archive
Index: doc/yap6_2_2_patch_1
===================================================================
--- doc/yap6_2_2_patch_1	(revision 4f40c3e6cf53f7c95a2a544455682c85f601e846)
+++ doc/yap6_2_2_patch_1	(revision 4f40c3e6cf53f7c95a2a544455682c85f601e846)
@@ -0,0 +1,33 @@
+diff -Naur -p0 yap-6.2.2/C/c_interface.c nyap-6.2.2/C/c_interface.c
+--- yap-6.2.2/C/c_interface.c	2011-10-01 13:04:16.000000000 -0700
++++ nyap-6.2.2/C/c_interface.c	2013-01-14 14:03:18.318705138 -0800
+@@ -2299 +2299 @@ YAP_CompileClause(Term t)
+-  int mod = CurrentModule;
++  Term mod = CurrentModule;
+diff -Naur -p0 yap-6.2.2/configure.in nyap-6.2.2/configure.in
+--- yap-6.2.2/configure.in	2011-10-23 15:11:26.000000000 -0700
++++ nyap-6.2.2/configure.in	2013-01-14 14:01:08.498704045 -0800
+@@ -1100,0 +1101 @@ dnl Linux has both elf and a.out, in thi
++        YAPLIB_LD=$SHLIB_LD
+diff -Naur -p0 yap-6.2.2/library/dialect/swi/fli/blobs.c nyap-6.2.2/library/dialect/swi/fli/blobs.c
+--- yap-6.2.2/library/dialect/swi/fli/blobs.c	2010-12-02 03:47:28.000000000 -0800
++++ nyap-6.2.2/library/dialect/swi/fli/blobs.c	2013-01-14 14:04:35.118703664 -0800
+@@ -22,0 +23,4 @@
++/* for freeBSD9.1 */
++#define _WITH_DPRINTF
++#include <stdio.h>
++
+diff -Naur -p0 yap-6.2.2/nyap-6.2.2/C/c_interface.c.rej nyap-6.2.2/nyap-6.2.2/C/c_interface.c.rej
+--- yap-6.2.2/nyap-6.2.2/C/c_interface.c.rej	2013-01-14 14:20:32.810703689 -0800
++++ nyap-6.2.2/nyap-6.2.2/C/c_interface.c.rej	1969-12-31 16:00:00.000000000 -0800
+@@ -1,5 +0,0 @@
+---- yap-6.2.2/C/c_interface.c	2011-10-01 13:04:16.000000000 -0700
+-+++ nyap-6.2.2/C/c_interface.c	2013-01-14 14:03:18.318705138 -0800
+-@@ -2299 +2299 @@
+--  int mod = CurrentModule;
+-+  Term mod = CurrentModule;
+diff -Naur -p0 yap-6.2.2/nyap-6.2.2/configure.in nyap-6.2.2/nyap-6.2.2/configure.in
+--- yap-6.2.2/nyap-6.2.2/configure.in	2013-01-14 14:20:32.810703689 -0800
++++ nyap-6.2.2/nyap-6.2.2/configure.in	1969-12-31 16:00:00.000000000 -0800
+@@ -1 +0,0 @@
+-        YAPLIB_LD=$SHLIB_LD
