Add android platform

This commit is contained in:
Victor Shcherb 2013-01-24 00:55:23 +01:00 committed by Alexey Pelykh
parent c8ca83836a
commit 3a42db9f6f
3 changed files with 30 additions and 2 deletions

View File

@ -54,7 +54,9 @@
# include "signal.h"
# include "sys/time.h"
# include "sys/types.h"
# ifndef __ANDROID__
# include "sys/sysctl.h"
# endif
# include "sys/utsname.h"
# include "sys/wait.h"

View File

@ -353,6 +353,21 @@ ifeq ($(platform),freebsd)
"-I$(JAVA_HOME)/include/freebsd" -I$(src) -pthread
cflags = $(build-cflags)
endif
ifeq ($(platform),android)
asm = arm
pointer-size = 4
no-psabi = -Wno-psabi
toolchain = $(ANDROID_NDK)/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86/
cflags = -std=gnu++0x -I$(ANDROID_NDK)/platforms/android-5/arch-arm/usr/include \
-I$(toolchain)/lib/gcc/arm-linux-androideabi/4.7/include $(common-cflags)
cflags += -marm $(no-psabi)
cxx = $(toolchain)/bin/arm-linux-androideabi-g++
cc = $(toolchain)/bin/arm-linux-androideabi-gcc
ar = $(toolchain)/bin/arm-linux-androideabi-ar
ranlib = $(toolchain)/bin/arm-linux-androideabi-ranlib
strip = $(toolchain)/bin/arm-linux-androideabi-strip
endif
ifeq ($(platform),darwin)
target-format = macho

View File

@ -12,10 +12,21 @@
# define __STDC_CONSTANT_MACROS
#endif
#include "sys/types.h"
#ifdef __APPLE__
# include "CoreFoundation/CoreFoundation.h"
# include "sys/ucontext.h"
# undef assert
#elif defined __ANDROID__
# include <asm/sigcontext.h> /* for sigcontext */
# include <asm/signal.h> /* for stack_t */
typedef struct ucontext {
unsigned long uc_flags;
struct ucontext *uc_link;
stack_t uc_stack;
struct sigcontext uc_mcontext;
unsigned long uc_sigmask;
} ucontext_t;
#else
# if defined __FreeBSD__
# include "limits.h"
@ -24,7 +35,7 @@
#endif
#include "sys/mman.h"
#include "sys/types.h"
#include "sys/stat.h"
#include "sys/time.h"
#include "time.h"
@ -37,10 +48,10 @@
#include "stdint.h"
#include "dirent.h"
#include "sched.h"
#include "arch.h"
#include "system.h"
#define ACQUIRE(x) MutexResource MAKE_NAME(mutexResource_) (x)
using namespace vm;