--- configure.orig	2011-11-30 10:40:33.000000000 +0100
+++ configure	2012-02-29 16:28:53.000000000 +0100
@@ -50,6 +50,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
 			
@@ -96,14 +110,14 @@
 		debug_flag=" -g "
 		ext=ud
 		optimization=" -DREGEXP_UNICODE "
-		wxcfg="--unicode=yes --debug=yes"
+		wxcfg="--unicode=yes "
 	else
 		objects_dir="Release_gcc_unicode"
 		configuration="Release_gcc_unicode"
 		ext=u
 		debug_flag=""
 		optimization=" -O3 -DREGEXP_UNICODE "
-		wxcfg="--unicode=yes --debug=no"
+		wxcfg="--unicode=yes "
 	fi
 
 	echo "OPT=${optimization}" >> Makefile
@@ -465,9 +479,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
