General changes to support freebsd system in building scripts
diff --git a/android-configure.sh b/android-configure.sh
index 59ec9b4..16e0d4d 100755
--- a/android-configure.sh
+++ b/android-configure.sh
@@ -203,6 +203,12 @@
 EXTRA_CFLAGS="$SDL_CFLAGS"
 EXTRA_LDFLAGS="$SDL_LIBS"
 
+case "$OS" in
+    freebsd-*)
+    EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm -lpthread"
+    ;;
+esac
+
 cat > $TMPC << EOF
 #include <SDL.h>
 #undef main
@@ -269,6 +275,8 @@
     ;;
     linux-*) PROBE_ALSA=yes; PROBE_OSS=yes; PROBE_ESD=yes;
     ;;
+    freebsd-*) PROBE_OSS=yes;
+    ;;
     windows) PROBE_WINAUDIO=yes
     ;;
 esac
@@ -414,6 +422,9 @@
     darwin-*) CONFIG_OS=DARWIN
               BSD=1
     ;;
+    freebsd-*) CONFIG_OS=FREEBSD
+              BSD=1
+    ;;
     windows*) CONFIG_OS=WIN32
     ;;
     *) CONFIG_OS=$OS
diff --git a/android/build/common.sh b/android/build/common.sh
index b22ef7d..565864f 100644
--- a/android/build/common.sh
+++ b/android/build/common.sh
@@ -88,6 +88,9 @@
     Linux)
         # note that building  32-bit binaries on x86_64 is handled later
         OS=linux-$CPU
+	;;
+    FreeBSD)
+        OS=freebsd-$CPU
         ;;
     CYGWIN*|*_NT-*)
         OS=windows
@@ -123,6 +126,8 @@
     ;;
     darwin-*) HOST_OS=darwin
     ;;
+    freebsd-*) HOST_OS=freebsd
+    ;;
     *) HOST_OS=$OS
 esac
 
@@ -161,6 +166,7 @@
         case $OS in
             linux-x86_64) OS=linux-x86 ;;
             darwin-x86_64) OS=darwin-x86 ;;
+	    freebsd-x86_64) OS=freebsd-x86 ;;
         esac
         HOST_ARCH=x86
         CPU=x86