Permalink
Browse files

Support uClibc compilation

  • Loading branch information...
1 parent 6f5fac8 commit b84e69b6e0d4c97398501f14ada51eced18b6063 @bkuhls bkuhls committed Dec 29, 2013
View
@@ -629,14 +629,14 @@ case $host in
use_x11=no
build_shared_lib=yes
;;
- i*86*-linux-gnu*)
+ i*86*-linux-gnu*|i*86*-*-linux-uclibc*)
ARCH="i486-linux"
if test "$use_cpu" = "no" -a "$cross_compiling" = "yes"; then
use_arch="x86"
use_cpu="i686"
fi
;;
- x86_64-*-linux-gnu*)
+ x86_64-*-linux-gnu*|x86_64-*-linux-uclibc*)
ARCH="x86_64-linux"
if test "$use_cpu" = "no" -a "$cross_compiling" = "yes"; then
use_arch="x86_64"
@@ -681,10 +681,10 @@ case $host in
ARCH="powerpc-osx"
use_arch="ppc"
;;
- powerpc-*-linux-gnu*)
+ powerpc-*-linux-gnu*|powerpc-*-linux-uclibc*)
ARCH="powerpc-linux"
;;
- powerpc64-*-linux-gnu*)
+ powerpc64-*-linux-gnu*|powerpc64-*-linux-uclibc*)
ARCH="powerpc64-linux"
;;
arm*-*-linux-gnu*)
View
@@ -2,10 +2,10 @@ AC_DEFUN([XBMC_SETUP_ARCH_DEFINES],[
# host detection and setup
case $host in
- i*86*-linux-gnu*)
+ i*86*-linux-gnu*|i*86*-*-linux-uclibc*)
AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX")
;;
- x86_64-*-linux-gnu*)
+ x86_64-*-linux-gnu*|x86_64-*-linux-uclibc*)
AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX")
;;
i386-*-freebsd*)
@@ -23,10 +23,10 @@ case $host in
powerpc-apple-darwin*)
AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_OSX -D_LINUX")
;;
- powerpc-*-linux-gnu*)
+ powerpc-*-linux-gnu*|powerpc-*-linux-uclibc*)
AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -D_POWERPC")
;;
- powerpc64-*-linux-gnu*)
+ powerpc64-*-linux-gnu*|powerpc64-*-linux-uclibc*)
AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -D_POWERPC64")
;;
arm*-*-linux-gnu*)
@@ -129,12 +129,12 @@ case $host in
platform_cxxflags="$platform_cflags"
platform_os="linux"
;;
- *i686*-linux-gnu*)
+ *i686*-linux-gnu*|i*86*-*-linux-uclibc*)
use_cpu=$host_cpu
use_toolchain="${use_toolchain:-/usr}"
platform_os="linux"
;;
- x86_64*-linux-gnu*)
+ x86_64*-linux-gnu*|x86_64-*-linux-uclibc*)
use_cpu=$host_cpu
use_toolchain="${use_toolchain:-/usr}"
platform_cflags="-fPIC -DPIC"
@@ -41,9 +41,9 @@ typedef fpos_t fpos64_t;
typedef void ( *PFV)(void);
-#define __IS_STDIN_STREAM(stream) (stream == stdin || stream->_file == stdin->_file || stream->_file == 0)
-#define __IS_STDOUT_STREAM(stream) (stream == stdout || stream->_file == stdout->_file || stream->_file == 1)
-#define __IS_STDERR_STREAM(stream) (stream == stderr || stream->_file == stderr->_file || stream->_file == 2)
+#define __IS_STDIN_STREAM(stream) (stream == stdin || fileno(stream) == fileno(stdin) || fileno(stream) == 0)
+#define __IS_STDOUT_STREAM(stream) (stream == stdout || fileno(stream) == fileno(stdout) || fileno(stream) == 1)
+#define __IS_STDERR_STREAM(stream) (stream == stderr || fileno(stream) == fileno(stderr) || fileno(stream) == 2)
#define IS_STDIN_STREAM(stream) (stream != NULL && __IS_STDIN_STREAM(stream))
#define IS_STDOUT_STREAM(stream) (stream != NULL && __IS_STDOUT_STREAM(stream))
#define IS_STDERR_STREAM(stream) (stream != NULL && __IS_STDERR_STREAM(stream))
@@ -27,8 +27,10 @@
#include "system.h"
#include "threads/CriticalSection.h"
-#if defined(TARGET_POSIX) && !defined(TARGET_DARWIN) && !defined(TARGET_FREEBSD) && !defined(TARGET_ANDROID)
+#if defined(TARGET_POSIX) && !defined(TARGET_DARWIN) && !defined(TARGET_FREEBSD) && !defined(TARGET_ANDROID) && !defined(__UCLIBC__)
#define _file _fileno
+#elif defined(__UCLIBC__)
+#define _file __filedes
#endif
#define MAX_EMULATED_FILES 50

0 comments on commit b84e69b

Please sign in to comment.