forked from 0ad/0ad
Vague start at hypothetical Android support
This was SVN commit r10923.
This commit is contained in:
parent
bed2a781c2
commit
182bf2b4af
@ -28,6 +28,8 @@ else
|
|||||||
arch = os.getenv("HOSTTYPE")
|
arch = os.getenv("HOSTTYPE")
|
||||||
if arch == "x86_64" then
|
if arch == "x86_64" then
|
||||||
arch = "amd64"
|
arch = "amd64"
|
||||||
|
elseif arch == "arm" then
|
||||||
|
arch = "arm"
|
||||||
else
|
else
|
||||||
os.execute("gcc -dumpmachine > .gccmachine.tmp")
|
os.execute("gcc -dumpmachine > .gccmachine.tmp")
|
||||||
local f = io.open(".gccmachine.tmp", "r")
|
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
|
-- do something (?) so that ccache can handle compilation with PCH enabled
|
||||||
"-fpch-preprocess",
|
"-fpch-preprocess",
|
||||||
|
|
||||||
-- enable SSE intrinsics
|
|
||||||
"-msse",
|
|
||||||
|
|
||||||
-- don't omit frame pointers (for now), because performance will be impacted
|
-- 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
|
-- negatively by the way this breaks profilers more than it will be impacted
|
||||||
-- positively by the optimisation
|
-- positively by the optimisation
|
||||||
"-fno-omit-frame-pointer"
|
"-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
|
if os.is("linux") then
|
||||||
linkoptions { "-Wl,--no-undefined", "-Wl,--as-needed" }
|
linkoptions { "-Wl,--no-undefined", "-Wl,--as-needed" }
|
||||||
end
|
end
|
||||||
|
@ -142,13 +142,13 @@ extern unsigned __int64 _byteswap_uint64(unsigned __int64);
|
|||||||
# define swap64 _byteswap_uint64
|
# define swap64 _byteswap_uint64
|
||||||
#elif defined(linux)
|
#elif defined(linux)
|
||||||
# include <asm/byteorder.h>
|
# include <asm/byteorder.h>
|
||||||
# ifdef __arch__swab16
|
# if defined(__arch__swab16) && !defined(swap16)
|
||||||
# define swap16 __arch__swab16
|
# define swap16 __arch__swab16
|
||||||
# endif
|
# endif
|
||||||
# ifdef __arch__swab32
|
# if defined(__arch__swab32) && !defined(swap32)
|
||||||
# define swap32 __arch__swab32
|
# define swap32 __arch__swab32
|
||||||
# endif
|
# endif
|
||||||
# ifdef __arch__swab64
|
# if defined(__arch__swab64) && !defined(swap64)
|
||||||
# define swap64 __arch__swab64
|
# define swap64 __arch__swab64
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -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
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
@ -20,6 +20,9 @@
|
|||||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* 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
|
// despite the comment in wposix.h about not using Windows headers for
|
||||||
// POSIX declarations, this one is harmless (no incompatible declarations)
|
// POSIX declarations, this one is harmless (no incompatible declarations)
|
||||||
// and can safely be used on Windows as well.
|
// and can safely be used on Windows as well.
|
||||||
@ -27,8 +30,27 @@
|
|||||||
|
|
||||||
#if OS_WIN
|
#if OS_WIN
|
||||||
# include "lib/sysdep/os/win/wposix/waio.h"
|
# 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
|
#else
|
||||||
# include <aio.h>
|
# include <aio.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "lib/posix/posix_errno.h" // for user convenience
|
#include "lib/posix/posix_errno.h" // for user convenience
|
||||||
|
|
||||||
|
#endif // #ifndef INCLUDED_POSIX_AIO
|
||||||
|
@ -53,6 +53,12 @@
|
|||||||
#else
|
#else
|
||||||
# define OS_LINUX 0
|
# define OS_LINUX 0
|
||||||
#endif
|
#endif
|
||||||
|
// Android (subset of Linux)
|
||||||
|
#if defined(__ANDROID__)
|
||||||
|
# define OS_ANDROID 1
|
||||||
|
#else
|
||||||
|
# define OS_ANDROID 0
|
||||||
|
#endif
|
||||||
// Mac OS X
|
// Mac OS X
|
||||||
#if (defined(__APPLE__) && defined(__MACH__))
|
#if (defined(__APPLE__) && defined(__MACH__))
|
||||||
# define OS_MACOSX 1
|
# define OS_MACOSX 1
|
||||||
|
@ -36,7 +36,9 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Redefine signbit to fix build error in GCC
|
// 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/jstypedarray.h"
|
||||||
#include "js/jsdbgapi.h"
|
#include "js/jsdbgapi.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user