--- configure.orig	2013-01-23 17:10:11.000000000 +0100
+++ configure	2013-02-01 15:11:13.000000000 +0100
@@ -84,6 +84,20 @@
                         with_clang="yes"
 
 		fi
+	elif [ "$os_name" = "FreeBSD" ]; then
+		arch=$(uname -m)
+		if [ $arch = "amd64" -o $arch = "sparc64" ]; then
+			compiler_extras="-m64 -DON_64_BIT "
+			c_compiler_extras="-m64 -DON_64_BIT "
+		else
+			compiler_extras="-m32 "
+			c_compiler_extras="-m32 "
+		fi
+		## clang
+		%%ENABLE_CLANG%%      with_clang="yes"
+		%%ENABLE_CLANG%%      lib_clang_cmp_flags=" -DHAS_LIBCLANG -I%%LOCALBASE%%/include "
+		%%ENABLE_CLANG%%      lib_clang_link_flags=" -L%%LOCALBASE%%/lib -lclang "
+		%%ENABLE_CLANG%%      lib_clang="%%LOCALBASE%%/lib/libclang.so"
 	else # Not darwin
 		if [ "$is_64bit" = "yes" ]; then
 			
@@ -785,9 +799,9 @@
 	elif [ "$rule_name" = "DatabaseLayerSQLite" ] ; then
 	  	createVariables "yes" "-I${base_dir}/sdk/databaselayer/src/sqlite3"
 	elif [ "$rule_name" = "DatabaseLayerMySQL" ] ; then
-	  	createVariables "yes" "-I/usr/include/mysql"
+	  	createVariables "yes" "-I%%LOCALBASE%%/include/mysql"
 	elif [ "$rule_name" = "DatabaseLayerPostgres" ] ; then
-	  	createVariables "yes" "-I/usr/include/postgresql"
+	  	createVariables "yes" "-I%%LOCALBASE%%/include/postgresql"
 	elif [ "$rule_name" = "DatabaseExplorer" ] ; then
 		
 		if [ "$os_name" != "Darwin" ];then
