aboutsummaryrefslogtreecommitdiff
path: root/m4/xbmc_arch.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/xbmc_arch.m4')
-rw-r--r--m4/xbmc_arch.m451
1 files changed, 51 insertions, 0 deletions
diff --git a/m4/xbmc_arch.m4 b/m4/xbmc_arch.m4
new file mode 100644
index 0000000000..147f0b1d82
--- /dev/null
+++ b/m4/xbmc_arch.m4
@@ -0,0 +1,51 @@
+AC_DEFUN([XBMC_SETUP_ARCH_DEFINES],[
+
+# host detection and setup
+case $host in
+ i*86*-linux-gnu*)
+ AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX")
+ ;;
+ x86_64-*-linux-gnu*)
+ AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX")
+ ;;
+ i386-*-freebsd*)
+ AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_FREEBSD -D_LINUX")
+ ;;
+ amd64-*-freebsd*)
+ AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_FREEBSD -D_LINUX")
+ ;;
+ arm-apple-darwin*)
+ AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_IOS -D_LINUX")
+ ;;
+ *86*-apple-darwin*)
+ AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_OSX -D_LINUX")
+ ;;
+ powerpc-apple-darwin*)
+ AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_OSX -D_LINUX")
+ ;;
+ powerpc-*-linux-gnu*)
+ AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -D_POWERPC")
+ ;;
+ powerpc64-*-linux-gnu*)
+ AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -D_POWERPC64")
+ ;;
+ arm*-*-linux-gnu*)
+ AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX")
+ ;;
+ arm*-*linux-android*)
+ AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -DTARGET_ANDROID")
+ ;;
+ *)
+ AC_MSG_ERROR(unsupported host ($host))
+esac
+
+if test "$target_platform" = "target_android" ; then
+ AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -DTARGET_ANDROID")
+fi
+
+case $use_platform in
+ raspberry-pi)
+ AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -D_ARMEL -DTARGET_RASPBERRY_PI")
+ ;;
+esac
+])