1
0
forked from 0ad/0ad

Vague start at hypothetical Android support

This was SVN commit r10923.
This commit is contained in:
Ykkrosh 2012-01-17 22:05:43 +00:00
parent bed2a781c2
commit 182bf2b4af
5 changed files with 49 additions and 8 deletions

View File

@ -28,6 +28,8 @@ else
arch = os.getenv("HOSTTYPE")
if arch == "x86_64" then
arch = "amd64"
elseif arch == "arm" then
arch = "arm"
else
os.execute("gcc -dumpmachine > .gccmachine.tmp")
local f = io.open(".gccmachine.tmp", "r")
@ -205,15 +207,24 @@ function project_set_build_flags()
-- do something (?) so that ccache can handle compilation with PCH enabled
"-fpch-preprocess",
-- enable SSE intrinsics
"-msse",
-- don't omit frame pointers (for now), because performance will be impacted
-- negatively by the way this breaks profilers more than it will be impacted
-- positively by the optimisation
"-fno-omit-frame-pointer"
}
if arch == "x86" or arch == "amd64" then
buildoptions {
-- enable SSE intrinsics
"-msse"
}
end
if arch == "arm" then
-- disable warnings about va_list ABI change
buildoptions { "-Wno-psabi" }
end
if os.is("linux") then
linkoptions { "-Wl,--no-undefined", "-Wl,--as-needed" }
end

View File

@ -142,13 +142,13 @@ extern unsigned __int64 _byteswap_uint64(unsigned __int64);
# define swap64 _byteswap_uint64
#elif defined(linux)
# include <asm/byteorder.h>
# ifdef __arch__swab16
# if defined(__arch__swab16) && !defined(swap16)
# define swap16 __arch__swab16
# endif
# ifdef __arch__swab32
# if defined(__arch__swab32) && !defined(swap32)
# define swap32 __arch__swab32
# endif
# ifdef __arch__swab64
# if defined(__arch__swab64) && !defined(swap64)
# define swap64 __arch__swab64
# endif
#endif

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2010 Wildfire Games
/* Copyright (c) 2012 Wildfire Games
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -20,6 +20,9 @@
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef INCLUDED_POSIX_AIO
#define INCLUDED_POSIX_AIO
// despite the comment in wposix.h about not using Windows headers for
// POSIX declarations, this one is harmless (no incompatible declarations)
// and can safely be used on Windows as well.
@ -27,8 +30,27 @@
#if OS_WIN
# include "lib/sysdep/os/win/wposix/waio.h"
#elif OS_ANDROID
// Android doesn't provide aio.h. We don't actually use aio on Linuxes (see
// CONFIG2_FILE_ENABLE_AIO) but we use its symbols and structs, so define
// them here
# define LIO_READ 0
# define LIO_WRITE 1
# define LIO_NOP 2
struct aiocb
{
int aio_fildes;
off_t aio_offset;
volatile void* aio_buf;
size_t aio_nbytes;
int aio_reqprio;
struct sigevent aio_sigevent;
int aio_lio_opcode;
};
#else
# include <aio.h>
#endif
#include "lib/posix/posix_errno.h" // for user convenience
#endif // #ifndef INCLUDED_POSIX_AIO

View File

@ -53,6 +53,12 @@
#else
# define OS_LINUX 0
#endif
// Android (subset of Linux)
#if defined(__ANDROID__)
# define OS_ANDROID 1
#else
# define OS_ANDROID 0
#endif
// Mac OS X
#if (defined(__APPLE__) && defined(__MACH__))
# define OS_MACOSX 1

View File

@ -36,7 +36,9 @@
#endif
// Redefine signbit to fix build error in GCC
#define signbit std::signbit
#ifndef signbit
# define signbit std::signbit
#endif
#include "js/jstypedarray.h"
#include "js/jsdbgapi.h"