Browse Source

Upload

android-fixes
JusicP 3 years ago
parent
commit
af3ceed851
  1. 2
      .gitignore
  2. 12
      appframework/sdlmgr.cpp
  3. 4
      common/freetype/config/ftconfig.h
  4. 15
      common/sse2neon.h
  5. 2
      datacache/wscript
  6. 8
      engine/sys_dll2.cpp
  7. 7
      engine/wscript
  8. 10
      filesystem/basefilesystem.cpp
  9. 4
      filesystem/filesystem_stdio.cpp
  10. 2
      game/client/mumble.cpp
  11. 2
      gameui/wscript
  12. 2
      inputsystem/wscript
  13. 300
      launcher/launcher.cpp
  14. 2
      launcher/wscript
  15. 1
      launcher_main/main.cpp
  16. 2
      launcher_main/wscript
  17. 4
      materialsystem/shaderapidx9/wscript
  18. 2
      materialsystem/stdshaders/wscript
  19. 2
      materialsystem/wscript
  20. 285
      output
  21. 10
      public/filesystem_init.cpp
  22. 10
      public/tier0/memoverride.cpp
  23. 4
      scenefilecache/wscript
  24. BIN
      scripts/waifulib/compiler_optimizations.pyc
  25. BIN
      scripts/waifulib/fwgslib.pyc
  26. 2
      scripts/waifulib/reconfigure.py
  27. BIN
      scripts/waifulib/xcompile.pyc
  28. 2
      soundemittersystem/wscript
  29. 2
      studiorender/wscript
  30. 2
      tier0/assert_dialog.cpp
  31. 12
      tier0/dbg.cpp
  32. 3
      tier0/platform_posix.cpp
  33. 5
      tier0/threadtools.cpp
  34. 2
      tier0/wscript
  35. 19
      tier1/interface.cpp
  36. 7
      tier1/pathmatch.cpp
  37. 4
      tier1/strtools.cpp
  38. 4
      tier1/wscript
  39. 4
      togl/linuxwin/glentrypoints.cpp
  40. 1
      togl/wscript
  41. 2
      vgui2/src/wscript
  42. 4
      vgui2/vgui_surfacelib/wscript
  43. 8
      vguimatsurface/wscript
  44. 2
      vstdlib/wscript
  45. 8
      wafandroid
  46. 48
      wscript

2
.gitignore vendored

@ -1,9 +1,7 @@ @@ -1,9 +1,7 @@
*.mak
*.mak.vpc_crc
*.vpc_crc
*.a
*.project
lib/
*obj_*
build/
.waf*

12
appframework/sdlmgr.cpp

@ -475,7 +475,11 @@ InitReturnVal_t CSDLMgr::Init() @@ -475,7 +475,11 @@ InitReturnVal_t CSDLMgr::Init()
SDL_GL_SetAttribute( SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_DEBUG_FLAG );
}
#ifdef ANDROID
if (SDL_GL_LoadLibrary("libGL4ES.so") == -1)
#else
if (SDL_GL_LoadLibrary(NULL) == -1)
#endif
Error( "SDL_GL_LoadLibrary(NULL) failed: %s", SDL_GetError() );
#endif
}
@ -483,6 +487,14 @@ InitReturnVal_t CSDLMgr::Init() @@ -483,6 +487,14 @@ InitReturnVal_t CSDLMgr::Init()
fprintf(stderr, "SDL video target is '%s'\n", SDL_GetCurrentVideoDriver());
Msg("SDL video target is '%s'\n", SDL_GetCurrentVideoDriver());
SDL_version compiled;
SDL_version linked;
SDL_VERSION(&compiled);
SDL_GetVersion(&linked);
Msg("SDL compiled version: %d.%d.%d, linked: %d.%d.%d\n", compiled.major, compiled.minor, compiled.patch, linked.major, linked.minor, linked.patch);
m_bForbidMouseGrab = true;
if ( !CommandLine()->FindParm("-nomousegrab") && CommandLine()->FindParm("-mousegrab") )
{

4
common/freetype/config/ftconfig.h

@ -1,7 +1,11 @@ @@ -1,7 +1,11 @@
#ifndef __FTCONFIG_H__MULTILIB
#define __FTCONFIG_H__MULTILIB
#ifdef ANDROID
#include <sys/cdefs.h>
#else
#include <bits/wordsize.h>
#endif
#if __WORDSIZE == 32
# include "ftconfig-32.h"

15
common/sse2neon.h

@ -106,20 +106,7 @@ @@ -106,20 +106,7 @@
* __ARM_NEON is defined to a value indicating the Advanced SIMD (NEON)
* architecture supported.
*/
#if !defined(__ARM_NEON) || !defined(__ARM_NEON__)
#error "You must enable NEON instructions (e.g. -mfpu=neon) to use SSE2NEON."
#endif
#if !defined(__clang__)
#pragma GCC push_options
#pragma GCC target("fpu=neon")
#endif
#elif defined(__aarch64__)
#if !defined(__clang__)
#pragma GCC push_options
#pragma GCC target("+simd")
#endif
#else
#error "Unsupported target. Must be either ARMv7-A+NEON or ARMv8-A."
#endif
#endif

2
datacache/wscript vendored

@ -33,7 +33,7 @@ def build(bld): @@ -33,7 +33,7 @@ def build(bld):
defines = []
libs = ['tier0','tier1','tier2','tier3']
libs = ['tier0','tier1','tier2','tier3','iconv']
install_path = bld.env.LIBDIR

8
engine/sys_dll2.cpp

@ -1006,18 +1006,26 @@ bool CEngineAPI::Connect( CreateInterfaceFn factory ) @@ -1006,18 +1006,26 @@ bool CEngineAPI::Connect( CreateInterfaceFn factory )
// Store off the app system factory...
g_AppSystemFactory = factory;
Warning( "CEngineAPI::Connect\n" );
if ( !BaseClass::Connect( factory ) )
return false;
Warning( "CEngineAPI::Connect2\n" );
g_pFileSystem = g_pFullFileSystem;
if ( !g_pFileSystem )
return false;
Warning( "CEngineAPI::Connect3\n" );
g_pFileSystem->SetWarningFunc( Warning );
if ( !Shader_Connect( true ) )
return false;
Warning( "CEngineAPI::Connect4\n" );
g_pPhysics = (IPhysics*)factory( VPHYSICS_INTERFACE_VERSION, NULL );
if ( !g_pStudioRender || !g_pDataCache || !g_pPhysics || !g_pMDLCache || !g_pMatSystemSurface || !g_pInputSystem /* || !g_pVideo */ )

7
engine/wscript

@ -323,12 +323,15 @@ def build(bld): @@ -323,12 +323,15 @@ def build(bld):
'../common',
'audio',
'audio/public',
'audio/private'
'audio/private',
'../thirdparty/openal-soft-android/include',
'../thirdparty/curl/include'
]
defines = []
libs = ['tier0','vgui_controls','dmxloader','tier1','tier2','tier3','bitmap','vstdlib','appframework','datamodel','vtf','mathlib','steam_api','matsys_controls','BZ2','SDL2','JPEG','ZLIB','OPENAL','CURL']
#libs = ['tier0','vgui_controls','dmxloader','tier1','tier2','tier3','bitmap','vstdlib','appframework','datamodel','vtf','mathlib','steam_api','matsys_controls','BZ2','SDL2','JPEG','ZLIB','OPENAL','CURL'] linux
libs = ['tier0','vgui_controls','dmxloader','tier1','tier2','tier3','bitmap','vstdlib','appframework','datamodel','vtf','mathlib','steam_api','matsys_controls','BZ2','sdl2','jpeg','zlib','openal','curl','ssl','crypto']
install_path = bld.env.LIBDIR

10
filesystem/basefilesystem.cpp

@ -3770,8 +3770,10 @@ bool CBaseFileSystem::IsFileWritable( char const *pFileName, char const *pPathID @@ -3770,8 +3770,10 @@ bool CBaseFileSystem::IsFileWritable( char const *pFileName, char const *pPathID
{
#ifdef WIN32
if( buf.st_mode & _S_IWRITE )
#elif LINUX
#elif defined (LINUX) && !defined (ANDROID)
if( buf.st_mode & S_IWRITE )
#elif ANDROID
if( buf.st_mode & S_IWUSR )
#else
if( buf.st_mode & S_IWRITE )
#endif
@ -3792,8 +3794,10 @@ bool CBaseFileSystem::IsFileWritable( char const *pFileName, char const *pPathID @@ -3792,8 +3794,10 @@ bool CBaseFileSystem::IsFileWritable( char const *pFileName, char const *pPathID
{
#ifdef WIN32
if ( buf.st_mode & _S_IWRITE )
#elif LINUX
#elif defined (LINUX) && !defined (ANDROID)
if ( buf.st_mode & S_IWRITE )
#elif ANDROID
if ( buf.st_mode & S_IWUSR )
#else
if ( buf.st_mode & S_IWRITE )
#endif
@ -3812,6 +3816,8 @@ bool CBaseFileSystem::SetFileWritable( char const *pFileName, bool writable, con @@ -3812,6 +3816,8 @@ bool CBaseFileSystem::SetFileWritable( char const *pFileName, bool writable, con
#ifdef _WIN32
int pmode = writable ? ( _S_IWRITE | _S_IREAD ) : ( _S_IREAD );
#elif ANDROID
int pmode = writable ? ( S_IWUSR | S_IRUSR ) : ( S_IRUSR );
#else
int pmode = writable ? ( S_IWRITE | S_IREAD ) : ( S_IREAD );
#endif

4
filesystem/filesystem_stdio.cpp

@ -972,7 +972,11 @@ void CStdioFile::FS_fclose() @@ -972,7 +972,11 @@ void CStdioFile::FS_fclose()
AUTO_LOCK( m_MutexLockedFD );
struct _stat buf;
#ifdef ANDROID
int fd = fileno( m_pFile ); // need to test this
#else
int fd = fileno_unlocked( m_pFile );
#endif
fstat( fd, &buf );
fflush( m_pFile );

2
game/client/mumble.cpp

@ -98,6 +98,8 @@ void CMumbleSystem::LevelInitPostEntity() @@ -98,6 +98,8 @@ void CMumbleSystem::LevelInitPostEntity()
g_hMapObject = NULL;
return;
}
#elif defined( ANDROID )
return; // TODO: implement
#elif defined( POSIX )
char memname[256];
V_sprintf_safe( memname, "/MumbleLink.%d", getuid() );

2
gameui/wscript

@ -107,7 +107,7 @@ def build(bld): @@ -107,7 +107,7 @@ def build(bld):
defines = []
libs = ['tier0','vgui_controls','tier1','tier2','tier3','vstdlib','vtf','bitmap','mathlib','SDL2','steam_api','matsys_controls','JPEG','PNG']
libs = ['tier0','vgui_controls','tier1','tier2','tier3','vstdlib','vtf','bitmap','mathlib','sdl2','steam_api','matsys_controls','jpeg','png','zlib']
install_path = bld.env.LIBDIR

2
inputsystem/wscript

@ -32,7 +32,7 @@ def build(bld): @@ -32,7 +32,7 @@ def build(bld):
defines = []
libs = ['tier0','tier1','tier2','vstdlib','SDL2','steam_api']
libs = ['tier0','tier1','tier2','vstdlib','sdl2','steam_api']
install_path = bld.env.LIBDIR

300
launcher/launcher.cpp

@ -82,6 +82,11 @@ int MessageBox( HWND hWnd, const char *message, const char *header, unsigned uTy @@ -82,6 +82,11 @@ int MessageBox( HWND hWnd, const char *message, const char *header, unsigned uTy
#define RELAUNCH_FILE "/tmp/hl2_relaunch"
#endif
#if defined ( ANDROID )
#include <android/log.h>
#include "jni.h"
#endif
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
@ -681,7 +686,6 @@ bool CSourceAppSystemGroup::Create() @@ -681,7 +686,6 @@ bool CSourceAppSystemGroup::Create()
if ( !AddSystems( appSystems ) )
return false;
// This will be NULL for games that don't support VR. That's ok. Just don't load the DLL
AppModule_t sourceVRModule = LoadModule( "sourcevr" DLL_EXT_STRING );
if( sourceVRModule != APP_MODULE_INVALID )
@ -934,7 +938,9 @@ bool GrabSourceMutex() @@ -934,7 +938,9 @@ bool GrabSourceMutex()
CRC32_ProcessBuffer( &gameCRC, (void *)pchGameParam, Q_strlen( pchGameParam ) );
CRC32_Final( &gameCRC );
#ifdef LINUX
#ifdef ANDROID
return true;
#elif defined (LINUX)
/*
* Linux
*/
@ -1166,6 +1172,294 @@ static const char *BuildCommand() @@ -1166,6 +1172,294 @@ static const char *BuildCommand()
return (const char *)build.Base();
}
#ifdef ANDROID
char dataDir[512];
const char *LauncherArgv[512];
char javaArgv[2048];
char gameName[512];
char startArgs[256][128];
char language[1024] = "english";
int iLastArgs = 0;
static int scr_width,scr_height;
bool bClient_loaded = false;
bool bShowTouch = true;
void *libclient;
static struct jnimethods_s
{
jclass actcls;
JavaVM *vm;
JNIEnv *env;
jmethodID enableTextInput;
} jni;
DLL_EXPORT int Java_com_valvesoftware_ValveActivity2_setMainPackFilePath(JNIEnv *env, jclass *clazz, jstring str)
{
__android_log_print( ANDROID_LOG_DEBUG, "SourceSDK2013", "Java_com_valvesoftware_ValveActivity_setMainPackFilePath" );
return setenv( "VALVE_PAK0_PATH", env->GetStringUTFChars(str, NULL), 1 );
}
DLL_EXPORT int Java_com_valvesoftware_ValveActivity2_setPatchPackFilePath(JNIEnv *env, jclass *clazz, jstring str)
{
__android_log_print( ANDROID_LOG_DEBUG, "SourceSDK2013", "Java_com_valvesoftware_ValveActivity_setPatchPackFilePath" );
return setenv( "VALVE_PAK1_PATH", env->GetStringUTFChars(str, NULL), 1 );
}
DLL_EXPORT void Java_com_valvesoftware_ValveActivity2_setCacheDirectoryPath(JNIEnv *env, jclass *clazz, jstring str)
{
__android_log_print( ANDROID_LOG_DEBUG, "SourceSDK2013", "Java_com_valvesoftware_ValveActivity_setCacheDirectoryPath" );
//return setenv( "VALVE_CACHE_PATH", env->GetStringUTFChars(str, NULL), 1 );
}
DLL_EXPORT void Java_com_valvesoftware_ValveActivity2_gpgsStart()
{
__android_log_print( ANDROID_LOG_DEBUG, "SourceSDK2013", "Java_com_valvesoftware_ValveActivity_gpgsStart" );
}
DLL_EXPORT void Java_com_valvesoftware_ValveActivity2_nativeOnActivityResult()
{
__android_log_print( ANDROID_LOG_DEBUG, "SourceSDK2013", "Java_com_valvesoftware_ValveActivity_nativeOnActivityResult" );
}
DLL_EXPORT void Java_com_valvesoftware_ValveActivity2_setNativeLibPath(JNIEnv *env, jclass *clazz, jstring str)
{
__android_log_print( ANDROID_LOG_DEBUG, "SourceSDK2013", "Java_com_valvesoftware_ValveActivity_setNativeLibPath" );
// snprintf(dataDir, sizeof dataDir, env->GetStringUTFChars(str, NULL));
}
DLL_EXPORT void Java_com_valvesoftware_ValveActivity2_setLanguage(JNIEnv *env, jclass *clazz, jstring str)
{
snprintf(language, sizeof language, "%s", env->GetStringUTFChars(str, NULL));
__android_log_print( ANDROID_LOG_DEBUG, "SourceSDK2013", "Java_com_valvesoftware_ValveActivity_setLanguage" );
}
DLL_EXPORT int Java_com_valvesoftware_ValveActivity2_setDocumentDirectoryPath(JNIEnv *env, jclass *clazz, jstring str)
{
__android_log_print( ANDROID_LOG_DEBUG, "SourceSDK2013", "Java_com_valvesoftware_ValveActivity_setDocumentDirectoryPath" );
setenv( "HOME", env->GetStringUTFChars(str, NULL), 1);
return setenv( "VALVE_CACHE_PATH", env->GetStringUTFChars(str, NULL), 1 );
}
DLL_EXPORT int Java_com_valvesoftware_ValveActivity2_setDropMip(int a1, int a2, signed int a3)
{
__android_log_print( ANDROID_LOG_DEBUG, "SourceSDK2013", "Java_com_valvesoftware_ValveActivity_setDropMip" );
}
DLL_EXPORT int Java_com_valvesoftware_ValveActivity2_saveGame()
{
__android_log_print( ANDROID_LOG_DEBUG, "SourceSDK2013", "Java_com_valvesoftware_ValveActivity_saveGame" );
}
DLL_EXPORT int Java_com_valvesoftware_ValveActivity2_setDataDirectoryPath(JNIEnv *env, jclass *clazz, jstring str)
{
__android_log_print( ANDROID_LOG_DEBUG, "SourceSDK2013", "Java_com_valvesoftware_ValveActivity_setDataDirectoryPath" );
snprintf(dataDir, sizeof dataDir, env->GetStringUTFChars(str, NULL));
}
DLL_EXPORT int Java_com_valvesoftware_ValveActivity2_setExtrasPackFilePath(JNIEnv *env, jclass *clazz, jstring str)
{
__android_log_print( ANDROID_LOG_DEBUG, "SourceSDK2013", "Java_com_valvesoftware_ValveActivity2_setExtrasPackFilePath" );
return setenv( "VALVE_PAK2_PATH", env->GetStringUTFChars(str, NULL), 1 );
}
DLL_EXPORT int Java_com_valvesoftware_ValveActivity2_setenv(JNIEnv *jenv, jclass *jclass, jstring env, jstring value, jint over)
{
__android_log_print( ANDROID_LOG_DEBUG, "SourceSDK2013", "Java_com_valvesoftware_ValveActivity2_setenv %s=%s", jenv->GetStringUTFChars(env, NULL),jenv->GetStringUTFChars(value, NULL) );
return setenv( jenv->GetStringUTFChars(env, NULL), jenv->GetStringUTFChars(value, NULL), over );
}
DLL_EXPORT int Java_com_valvesoftware_ValveActivity2_setGame(JNIEnv *jenv, jclass *jclass, jstring game)
{
snprintf(gameName, sizeof dataDir, "-game %s", jenv->GetStringUTFChars(game, NULL));
return setenv( "VALVE_MOD", jenv->GetStringUTFChars(game, NULL), 1);
}
typedef void (*t_TouchEvent)(int finger, int x, int y, int act);
t_TouchEvent TouchEvent;
DLL_EXPORT void clientLoaded( void )
{
bClient_loaded = true;
libclient = dlopen("libclient.so",0);
TouchEvent = (t_TouchEvent)dlsym(libclient, "TouchEvent");
((void (*)(bool, int, int))dlsym(libclient, "showTouch"))(bShowTouch, scr_width, scr_height);
}
DLL_EXPORT void showKeyboard( int show )
{
jni.env->CallStaticVoidMethod( jni.actcls, jni.enableTextInput, show );
}
DLL_EXPORT void JNICALL Java_com_valvesoftware_ValveActivity2_showTouch(JNIEnv *env, jobject obj, jboolean show_touch, jint width, jint height)
{
scr_width = width;
scr_height = height;
bShowTouch = show_touch;
}
DLL_EXPORT void JNICALL Java_com_valvesoftware_ValveActivity2_TouchEvent(JNIEnv *env, jobject obj, jint fingerid, jint x, jint y, jint action)
{
if( !bClient_loaded )
return;
TouchEvent( fingerid, x, y, action );
}
DLL_EXPORT const char* getSystemLanguage()
{
return language;
}
typedef void (*t_SDL_Android_Init)(JNIEnv* env, jclass cls);
t_SDL_Android_Init SDL_Android_Init;
//typedef void *(*t_SDL_StartTextInput)();
//t_SDL_StartTextInput SDL_StartTextInput;
typedef void (*t_egl_init)();
t_egl_init egl_init;
bool bUseGL;
void SetRenderer()
{
if ( bUseGL )
{
//setenv("USE_BIG_GL", "1", 1);
}
else
{
setenv("REGAL_LOG", "0", 1);
setenv("REGAL_LOG_ERROR", "0", 1);
setenv("REGAL_LOG_WARNING", "0", 1);
setenv("REGAL_LOG_INFO", "0", 1);
setenv("REGAL_LOG_HTTP", "0", 1);
setenv("REGAL_LOG_JSON", "0", 1);
setenv("REGAL_LOG_CALLBACK", "0", 1);
setenv("REGAL_LOG_ONCE", "0", 1);
setenv("REGAL_LOG_POINTERS", "0", 1);
setenv("REGAL_LOG_THREAD", "0", 1);
setenv("REGAL_LOG_PROCESS", "0", 1);
setenv("REGAL_LOG_ALL", "0", 1);
setenv("REGAL_DEBUG", "0", 1);
setenv("REGAL_ERROR", "0", 1);
setenv("REGAL_LOG_FILE", "/dev/null", 1);
setenv("REGAL_EMU_SO", "0", 1);
setenv("REGAL_THREAD_LOCKING", "0", 1);
setenv("REGAL_FORCE_ES2_PROFILE", "1", 1);
setenv("REGAL_SYS_GLX", "0", 1);
setenv("REGAL_SYS_ES2", "1", 1);
setenv("REGAL_SYS_EGL", "1", 1);
setenv("REGAL_SYS_GL", "0", 1);
setenv("REGAL_GL_VERSION", "2.1", 1);
setenv("REGAL_GL_EXTENSIONS", "GL_EXT_framebuffer_object GL_EXT_framebuffer_blit GL_OES_mapbuffer GL_EXT_texture_sRGB_decode GL_EXT_texture_compression_s3tc GL_EXT_texture_compression_dxt1", 1);
}
}
void SetArg( const char *arg )
{
char *pch;
char str[1024];
strncpy( str, arg, sizeof str );
pch = strtok (str," ");
while (pch != NULL)
{
strncpy( startArgs[iLastArgs], pch, sizeof startArgs[0] );
LauncherArgv[iLastArgs] = startArgs[iLastArgs];
iLastArgs++;
pch = strtok (NULL, " ");
}
}
DLL_EXPORT int Java_com_valvesoftware_ValveActivity2_setArgs(JNIEnv *env, jclass *clazz, jstring str)
{
snprintf( javaArgv, sizeof javaArgv, env->GetStringUTFChars(str, NULL) );
}
void SetStartArgs()
{
char lang[2048];
snprintf(lang, sizeof lang, "-language %s +cc_lang %s", language, language);
SetArg(dataDir);
SetArg(lang);
SetArg(gameName);
SetArg(javaArgv);
SetArg("-window "
"-nosteam "
"-nouserclip "
"+sv_unlockedchapters 99 "
"+mat_queue_mode 2 "
"-ignoredxsupportcfg "
"-regal "
"+gl_rt_forcergba 1 "
"+mat_antialias 1 "
"-mat_antialias 1 "
"+r_flashlightdepthtexture 1 "
"+gl_dropmips 1 "
"-insecure");
if( bUseGL )
SetArg("-userclip "
"-gl_disablesamplerobjects "
// "-egl "
"+gl_enabletexsubimage 1 "
"+gl_blitmode 1 "
"+gl_supportMapBuffer 0 "
"-gl_separatedepthstencil 0 "
"-gl_nodepthtexture 0 "
"+r_flashlight_version2 0 "
"+gl_emurgba16 0 "
"+gl_emunooverwrite 0");
else
SetArg("-nouserclip "
"-gl_disablesamplerobjects "
"+gl_enabletexsubimage 0 "
"+mat_reducefillrate 1 "
"+gl_blitmode 1 "
"+gl_supportMapBuffer 1 "
"-gl_separatedepthstencil 0 "// default is 1
"-gl_nodepthtexture 1 "
"+r_flashlight_version2 1 "
"+gl_emurgba16 1 "
"+gl_emunooverwrite 1");
}
DLL_EXPORT int LauncherMain( int argc, char **argv );
DLL_EXPORT int LauncherMainAndroid( int argc, char **argv )
{
//void *sdlHandle = dlopen("libSDL2.so", 0);
//SDL_Android_Init = (t_SDL_Android_Init)dlsym(sdlHandle, "SDL_Android_Init");
//SDL_Android_Init(env, cls);
//SDL_StartTextInput = (t_SDL_StartTextInput)dlsym(sdlHandle, "SDL_StartTextInput");
//SDL_StartTextInput();
// unused?
chdir(dataDir);
getcwd(dataDir, sizeof dataDir);
setenv( "VALVE_GAME_PATH", dataDir, 1 );
snprintf(dataDir, sizeof dataDir, "%s/hl2_linux", dataDir);
bUseGL = false;
SetRenderer();
SetStartArgs();
//#ifdef GL4ES
void *glHandle = dlopen("libGL4ES.so", 0);
egl_init = (t_egl_init)dlsym(glHandle, "egl_init");
if( egl_init )
egl_init();
//#endif
//jni.env = env;
//jni.actcls = env->FindClass("org/libsdl/app/SDLActivity");
//jni.enableTextInput = env->GetStaticMethodID(jni.actcls, "showKeyboard", "(I)V");
return LauncherMain(iLastArgs, LauncherArgv);
}
#endif
//-----------------------------------------------------------------------------
// Purpose: The real entry point for the application
// Input : hInstance -
@ -1175,7 +1469,7 @@ static const char *BuildCommand() @@ -1175,7 +1469,7 @@ static const char *BuildCommand()
// Output : int APIENTRY
//-----------------------------------------------------------------------------
#ifdef WIN32
extern "C" __declspec(dllexport) int LauncherMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow )
extern "C" __declspec(DLL_EXPORT) int LauncherMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow )
#else
DLL_EXPORT int LauncherMain( int argc, char **argv )
#endif

2
launcher/wscript

@ -31,7 +31,7 @@ def build(bld): @@ -31,7 +31,7 @@ def build(bld):
defines = []
libs = ['tier0','tier1','tier2','tier3','vstdlib','steam_api','appframework','SDL2','togl']
libs = ['tier0','tier1','tier2','tier3','vstdlib','steam_api','appframework','sdl2','togl','LOG']
install_path = bld.env.LIBDIR

1
launcher_main/main.cpp

@ -146,6 +146,7 @@ int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdL @@ -146,6 +146,7 @@ int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdL
#if defined( LINUX )
#include <fcntl.h>
#include <sys/stat.h>
static bool IsDebuggerPresent( int time )
{

2
launcher_main/wscript

@ -22,7 +22,7 @@ def build(bld): @@ -22,7 +22,7 @@ def build(bld):
libs = []
if bld.env.DEST_OS != 'win32':
libs += [ 'DL' ]
libs += [ 'DL', 'LOG' ]
else:
libs += ['USER32', 'SHELL32']
source += ['launcher_main.rc']

4
materialsystem/shaderapidx9/wscript

@ -15,7 +15,7 @@ def configure(conf): @@ -15,7 +15,7 @@ def configure(conf):
conf.env.append_unique('DEFINES',[
'SHADERAPIDX9',
'SHADER_DLL_EXPORT',
'PROTECTED_THINGS_ENABLE',
#'PROTECTED_THINGS_ENABLE', # conflicts with stlport
'strncpy=use_Q_strncpy_instead',
'_snprintf=use_Q_snprintf_instead',
'GL_GLEXT_PROTOTYPES',
@ -56,7 +56,7 @@ def build(bld): @@ -56,7 +56,7 @@ def build(bld):
defines = []
libs = ['tier0','tier1','tier2','vstdlib','togl','bitmap','mathlib']
libs = ['tier0','tier1','tier2','vstdlib','togl','bitmap','mathlib','iconv']
install_path = bld.env.LIBDIR

2
materialsystem/stdshaders/wscript

@ -148,7 +148,7 @@ def build(bld): @@ -148,7 +148,7 @@ def build(bld):
defines = []
libs = ['tier0','shaderlib','tier1','mathlib']
libs = ['tier0','shaderlib','tier1','mathlib','iconv']
install_path = bld.env.LIBDIR

2
materialsystem/wscript

@ -15,7 +15,7 @@ def configure(conf): @@ -15,7 +15,7 @@ def configure(conf):
conf.env.append_unique('DEFINES',[
'DEFINE_MATERIALSYSTEM_INTERFACE',
'MATERIALSYSTEM_EXPORTS',
'PROTECTED_THINGS_ENABLE',
#'PROTECTED_THINGS_ENABLE', # conflicts with stlport
'strncpy=use_Q_strncpy_instead',
'_snprintf=use_Q_snprintf_instead'
])

285
output

@ -0,0 +1,285 @@ @@ -0,0 +1,285 @@
<waflib.extras.clang_compilation_database.ClangDbContext object at 0x7f587bde5dd0>
<waflib.extras.clang_compilation_database.ClangDbContext object at 0x7f587bde5dd0>
<waflib.extras.clang_compilation_database.ClangDbContext object at 0x7f587bde5dd0>
<waflib.extras.clang_compilation_database.ClangDbContext object at 0x7f587bde5dd0>
<waflib.extras.clang_compilation_database.ClangDbContext object at 0x7f587bde5dd0>
<waflib.extras.clang_compilation_database.ClangDbContext object at 0x7f587bde5dd0>
<waflib.extras.clang_compilation_database.ClangDbContext object at 0x7f587bde5dd0>
Build commands will be stored in build/compile_commands.json
Waf: Entering directory `/home/jusic/source-engine/build'
<waflib.Build.BuildContext object at 0x7f587bfbfe90>
<waflib.Build.BuildContext object at 0x7f587bfbfe90>
<waflib.Build.BuildContext object at 0x7f587bfbfe90>
<waflib.Build.BuildContext object at 0x7f587bfbfe90>
<waflib.Build.BuildContext object at 0x7f587bfbfe90>
<waflib.Build.BuildContext object at 0x7f587bfbfe90>
<waflib.Build.BuildContext object at 0x7f587bfbfe90>
[ 31/2159] Linking build/tier0/libtier0.so
[ 32/2159] Compiling tier1/utlstring.cpp
[ 33/2159] Compiling tier1/utlbufferutil.cpp
[ 35/2159] Compiling tier1/utlbuffer.cpp
[ 36/2159] Compiling tier1/uniqueid.cpp
[ 37/2159] Compiling tier1/tokenreader.cpp
../tier1/pathmatch.cpp:416: error: undefined reference to '__cxa_end_cleanup'
../tier1/pathmatch.cpp:492: error: undefined reference to '__cxa_end_cleanup'
../tier1/pathmatch.cpp:508: error: undefined reference to '__cxa_guard_acquire'
../tier1/pathmatch.cpp:508: error: undefined reference to '__cxa_guard_release'
../tier1/pathmatch.cpp:512: error: undefined reference to '__cxa_guard_acquire'
../tier1/pathmatch.cpp:512: error: undefined reference to '__cxa_guard_release'
../tier1/pathmatch.cpp:751: error: undefined reference to '__cxa_end_cleanup'
../tier1/pathmatch.cpp:760: error: undefined reference to '__cxa_end_cleanup'
../tier1/pathmatch.cpp:770: error: undefined reference to 'fopen64'
../tier1/pathmatch.cpp:821: error: undefined reference to '__xstat'
../tier1/pathmatch.cpp:826: error: undefined reference to '__lxstat'
../tier1/pathmatch.cpp:831: error: undefined reference to '__xstat64'
../tier1/pathmatch.cpp:836: error: undefined reference to '__lxstat64'
tier1/pathmatch.cpp.31.o(.ARM.extab.text._ZN7CDirPtrD2Ev+0x0): error: undefined reference to '__gxx_personality_v0'
tier1/pathmatch.cpp.31.o(.ARM.extab+0x0): error: undefined reference to '__gxx_personality_v0'
tier1/pathmatch.cpp.31.o(.ARM.extab+0x58): error: undefined reference to '__gxx_personality_v0'
tier1/pathmatch.cpp.31.o(.ARM.extab+0x78): error: undefined reference to '__gxx_personality_v0'
../tier0/assert_dialog.cpp:109: error: undefined reference to '__cxa_guard_acquire'
../tier0/assert_dialog.cpp:109: error: undefined reference to '__cxa_guard_release'
../tier0/assert_dialog.cpp:109: error: undefined reference to '__cxa_guard_abort'
../tier0/assert_dialog.cpp:115: error: undefined reference to '__cxa_guard_acquire'
../tier0/assert_dialog.cpp:115: error: undefined reference to '__cxa_guard_release'
../tier0/assert_dialog.cpp:115: error: undefined reference to '__cxa_guard_abort'
../tier0/assert_dialog.cpp:148: error: undefined reference to 'operator delete(void*)'
../tier0/assert_dialog.cpp:166: error: undefined reference to 'operator new(unsigned int)'
../tier0/assert_dialog.cpp:376: error: undefined reference to '__cxa_guard_abort'
../tier0/commandline.cpp:116: error: undefined reference to 'operator delete[](void*)'
../tier0/commandline.cpp:117: error: undefined reference to 'operator delete(void*)'
../tier0/commandline.cpp:117: error: undefined reference to 'operator delete(void*)'
../tier0/commandline.cpp:231: error: undefined reference to 'operator delete[](void*)'
../tier0/commandline.cpp:273: error: undefined reference to 'operator new[](unsigned int)'
../tier0/commandline.cpp:420: error: undefined reference to 'operator new[](unsigned int)'
../tier0/commandline.cpp:437: error: undefined reference to 'operator new[](unsigned int)'
../tier0/commandline.cpp:450: error: undefined reference to 'operator delete[](void*)'
../tier0/commandline.cpp:512: error: undefined reference to 'operator new[](unsigned int)'
../tier0/commandline.cpp:589: error: undefined reference to 'operator delete[](void*)'
tier0/commandline.cpp.31.o:commandline.cpp:vtable for ICommandLine: error: undefined reference to '__cxa_pure_virtual'
tier0/commandline.cpp.31.o:commandline.cpp:vtable for ICommandLine: error: undefined reference to '__cxa_pure_virtual'
tier0/commandline.cpp.31.o:commandline.cpp:vtable for ICommandLine: error: undefined reference to '__cxa_pure_virtual'
tier0/commandline.cpp.31.o:commandline.cpp:vtable for ICommandLine: error: undefined reference to '__cxa_pure_virtual'
tier0/commandline.cpp.31.o:commandline.cpp:typeinfo for CCommandLine: error: undefined reference to 'vtable for __cxxabiv1::__si_class_type_info'
/home/jusic/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld: the vtable symbol may be undefined because the class is missing its key function
tier0/commandline.cpp.31.o:commandline.cpp:typeinfo for ICommandLine: error: undefined reference to 'vtable for __cxxabiv1::__class_type_info'
/home/jusic/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld: the vtable symbol may be undefined because the class is missing its key function
../tier0/dynfunction.cpp:59: error: undefined reference to 'operator delete(void*)'
../tier0/dynfunction.cpp:80: error: undefined reference to 'operator new(unsigned int)'
tier0/memstd.cpp.31.o:memstd.cpp:typeinfo for CStdMemAlloc: error: undefined reference to 'vtable for __cxxabiv1::__si_class_type_info'
/home/jusic/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld: the vtable symbol may be undefined because the class is missing its key function
tier0/memstd.cpp.31.o:memstd.cpp:typeinfo for IMemAlloc: error: undefined reference to 'vtable for __cxxabiv1::__class_type_info'
/home/jusic/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld: the vtable symbol may be undefined because the class is missing its key function
../tier0/threadtools.cpp:153: error: undefined reference to 'operator new(unsigned int)'
../tier0/threadtools.cpp:460: error: undefined reference to '__cxa_guard_abort'
../tier0/threadtools.cpp:1751: error: undefined reference to 'operator new(unsigned int)'
../tier0/threadtools.cpp:1896: error: undefined reference to '__cxa_allocate_exception'
../tier0/threadtools.cpp:1896: error: undefined reference to '__cxa_throw'
../tier0/threadtools.cpp:1900: error: undefined reference to 'typeinfo for int'
../tier0/threadtools.cpp:2143: error: undefined reference to '__cxa_end_catch'
../tier0/threadtools.cpp:2143: error: undefined reference to '__cxa_begin_catch'
../tier0/threadtools.cpp:2146: error: undefined reference to '__cxa_rethrow'
../tier0/threadtools.cpp:2162: error: undefined reference to '__cxa_begin_catch'
../tier0/threadtools.cpp:2162: error: undefined reference to '__cxa_end_catch'
tier0/threadtools.cpp.31.o:threadtools.cpp:typeinfo for CThread: error: undefined reference to 'vtable for __cxxabiv1::__class_type_info'
/home/jusic/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld: the vtable symbol may be undefined because the class is missing its key function
tier0/threadtools.cpp.31.o:threadtools.cpp:typeinfo for CWorkerThread: error: undefined reference to 'vtable for __cxxabiv1::__si_class_type_info'
/home/jusic/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld: the vtable symbol may be undefined because the class is missing its key function
/home/jusic/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_list.h:1697: error: undefined reference to 'std::__detail::_List_node_base::_M_unhook()'
/home/jusic/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_list.h:1689: error: undefined reference to 'std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)'
/home/jusic/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_list.h:1689: error: undefined reference to 'std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)'
/home/jusic/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_list.h:517: error: undefined reference to '__cxa_end_catch'
/home/jusic/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_list.h:517: error: undefined reference to '__cxa_begin_catch'
/home/jusic/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_list.h:520: error: undefined reference to '__cxa_rethrow'
/home/jusic/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_list.h:517: error: undefined reference to '__cxa_end_catch'
/home/jusic/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_list.h:517: error: undefined reference to '__cxa_begin_catch'
/home/jusic/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_list.h:520: error: undefined reference to '__cxa_rethrow'
/home/jusic/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include/ext/new_allocator.h:102: error: undefined reference to 'std::__throw_bad_alloc()'
tier0/tslist.cpp.31.o:tslist.cpp:typeinfo for TSListTests::CListOps: error: undefined reference to 'vtable for __cxxabiv1::__si_class_type_info'
/home/jusic/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld: the vtable symbol may be undefined because the class is missing its key function
tier0/tslist.cpp.31.o:tslist.cpp:typeinfo for TSListTests::CTestOps: error: undefined reference to 'vtable for __cxxabiv1::__class_type_info'
/home/jusic/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld: the vtable symbol may be undefined because the class is missing its key function
/home/jusic/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/vector.tcc:470: error: undefined reference to '__cxa_rethrow'
/home/jusic/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_tree.h:1185: error: undefined reference to 'std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)'
/home/jusic/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_tree.h:1185: error: undefined reference to 'std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)'
/home/jusic/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_vector.h:1585: error: undefined reference to 'std::__throw_length_error(char const*)'
/home/jusic/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_tree.h:218: error: undefined reference to 'std::_Rb_tree_decrement(std::_Rb_tree_node_base*)'
/home/jusic/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_tree.h:218: error: undefined reference to 'std::_Rb_tree_decrement(std::_Rb_tree_node_base*)'
/home/jusic/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include/ext/new_allocator.h:102: error: undefined reference to 'std::__throw_bad_alloc()'
/home/jusic/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include/ext/new_allocator.h:102: error: undefined reference to 'std::__throw_bad_alloc()'
/home/jusic/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include/ext/new_allocator.h:102: error: undefined reference to 'std::__throw_bad_alloc()'
collect2: error: ld returned 1 exit status
In file included from ../public/mathlib/vector.h:32:0,
from ../public/mathlib/mathlib.h:14,
from ../public/tier1/utlmemory.h:20,
from ../public/tier1/utlstring.h:14,
from ../tier1/utlstring.cpp:10:
../public/tier0/threadtools.h: In member function 'bool CThreadSpinRWLock::AssignIf(const CThreadSpinRWLock::LockInfo_t&, const CThreadSpinRWLock::LockInfo_t&)':
../public/tier0/threadtools.h:1743:48: warning: cast from 'volatile CThreadSpinRWLock::LockInfo_t*' to 'int64* {aka long long int*}' increases required alignment of target type [-Wcast-align]
return ThreadInterlockedAssignIf64( (int64 *)&m_lockInfo, *((int64 *)&newValue), *((int64 *)&comperand) );
^
../public/tier0/threadtools.h:1743:72: warning: cast from 'const CThreadSpinRWLock::LockInfo_t*' to 'int64* {aka long long int*}' increases required alignment of target type [-Wcast-align]
return ThreadInterlockedAssignIf64( (int64 *)&m_lockInfo, *((int64 *)&newValue), *((int64 *)&comperand) );
^
../public/tier0/threadtools.h:1743:95: warning: cast from 'const CThreadSpinRWLock::LockInfo_t*' to 'int64* {aka long long int*}' increases required alignment of target type [-Wcast-align]
return ThreadInterlockedAssignIf64( (int64 *)&m_lockInfo, *((int64 *)&newValue), *((int64 *)&comperand) );
^
In file included from ../public/tier1/utlmemory.h:22:0,
from ../public/tier1/utlstring.h:14,
from ../tier1/utlstring.cpp:10:
../public/tier0/memalloc.h: In function 'void* MemAlloc_AllocAligned(size_t, size_t)':
../public/tier0/memalloc.h:190:28: warning: cast from 'unsigned char*' to 'unsigned char**' increases required alignment of target type [-Wcast-align]
((unsigned char**)(pResult))[-1] = pAlloc;
^
../public/tier0/memalloc.h: In function 'void* MemAlloc_AllocAligned(size_t, size_t, const char*, int)':
../public/tier0/memalloc.h:208:28: warning: cast from 'unsigned char*' to 'unsigned char**' increases required alignment of target type [-Wcast-align]
((unsigned char**)(pResult))[-1] = pAlloc;
^
../public/tier0/memalloc.h: In function 'void* MemAlloc_AllocAlignedUnattributed(size_t, size_t)':
../public/tier0/memalloc.h:226:28: warning: cast from 'unsigned char*' to 'unsigned char**' increases required alignment of target type [-Wcast-align]
((unsigned char**)(pResult))[-1] = pAlloc;
^
../public/tier0/memalloc.h: In function 'void* MemAlloc_AllocAlignedFileLine(size_t, size_t, const char*, int)':
../public/tier0/memalloc.h:244:28: warning: cast from 'unsigned char*' to 'unsigned char**' increases required alignment of target type [-Wcast-align]
((unsigned char**)(pResult))[-1] = pAlloc;
^
In file included from ../public/tier1/utlvector.h:23:0,
from ../public/tier1/uniqueid.h:17,
from ../tier1/uniqueid.cpp:17:
../public/tier0/threadtools.h: In member function 'bool CThreadSpinRWLock::AssignIf(const CThreadSpinRWLock::LockInfo_t&, const CThreadSpinRWLock::LockInfo_t&)':
../public/tier0/threadtools.h:1743:48: warning: cast from 'volatile CThreadSpinRWLock::LockInfo_t*' to 'int64* {aka long long int*}' increases required alignment of target type [-Wcast-align]
return ThreadInterlockedAssignIf64( (int64 *)&m_lockInfo, *((int64 *)&newValue), *((int64 *)&comperand) );
^
../public/tier0/threadtools.h:1743:72: warning: cast from 'const CThreadSpinRWLock::LockInfo_t*' to 'int64* {aka long long int*}' increases required alignment of target type [-Wcast-align]
return ThreadInterlockedAssignIf64( (int64 *)&m_lockInfo, *((int64 *)&newValue), *((int64 *)&comperand) );
^
../public/tier0/threadtools.h:1743:95: warning: cast from 'const CThreadSpinRWLock::LockInfo_t*' to 'int64* {aka long long int*}' increases required alignment of target type [-Wcast-align]
return ThreadInterlockedAssignIf64( (int64 *)&m_lockInfo, *((int64 *)&newValue), *((int64 *)&comperand) );
^
In file included from ../public/tier1/utlmemory.h:22:0,
from ../public/tier1/utlvector.h:24,
from ../public/tier1/uniqueid.h:17,
from ../tier1/uniqueid.cpp:17:
../public/tier0/memalloc.h: In function 'void* MemAlloc_AllocAligned(size_t, size_t)':
../public/tier0/memalloc.h:190:28: warning: cast from 'unsigned char*' to 'unsigned char**' increases required alignment of target type [-Wcast-align]
((unsigned char**)(pResult))[-1] = pAlloc;
^
../public/tier0/memalloc.h: In function 'void* MemAlloc_AllocAligned(size_t, size_t, const char*, int)':
../public/tier0/memalloc.h:208:28: warning: cast from 'unsigned char*' to 'unsigned char**' increases required alignment of target type [-Wcast-align]
((unsigned char**)(pResult))[-1] = pAlloc;
^
../public/tier0/memalloc.h: In function 'void* MemAlloc_AllocAlignedUnattributed(size_t, size_t)':
../public/tier0/memalloc.h:226:28: warning: cast from 'unsigned char*' to 'unsigned char**' increases required alignment of target type [-Wcast-align]
((unsigned char**)(pResult))[-1] = pAlloc;
^
../public/tier0/memalloc.h: In function 'void* MemAlloc_AllocAlignedFileLine(size_t, size_t, const char*, int)':
../public/tier0/memalloc.h:244:28: warning: cast from 'unsigned char*' to 'unsigned char**' increases required alignment of target type [-Wcast-align]
((unsigned char**)(pResult))[-1] = pAlloc;
^
../tier1/utlbufferutil.cpp:9:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
#pragma warning (disable : 4514)
^
In file included from ../public/tier1/utlvector.h:23:0,
from ../public/tier1/utlbufferutil.h:17,
from ../tier1/utlbufferutil.cpp:11:
../public/tier0/threadtools.h: In member function 'bool CThreadSpinRWLock::AssignIf(const CThreadSpinRWLock::LockInfo_t&, const CThreadSpinRWLock::LockInfo_t&)':
../public/tier0/threadtools.h:1743:48: warning: cast from 'volatile CThreadSpinRWLock::LockInfo_t*' to 'int64* {aka long long int*}' increases required alignment of target type [-Wcast-align]
return ThreadInterlockedAssignIf64( (int64 *)&m_lockInfo, *((int64 *)&newValue), *((int64 *)&comperand) );
^
../public/tier0/threadtools.h:1743:72: warning: cast from 'const CThreadSpinRWLock::LockInfo_t*' to 'int64* {aka long long int*}' increases required alignment of target type [-Wcast-align]
return ThreadInterlockedAssignIf64( (int64 *)&m_lockInfo, *((int64 *)&newValue), *((int64 *)&comperand) );
^
../public/tier0/threadtools.h:1743:95: warning: cast from 'const CThreadSpinRWLock::LockInfo_t*' to 'int64* {aka long long int*}' increases required alignment of target type [-Wcast-align]
return ThreadInterlockedAssignIf64( (int64 *)&m_lockInfo, *((int64 *)&newValue), *((int64 *)&comperand) );
^
In file included from ../public/tier1/utlmemory.h:22:0,
from ../public/tier1/utlvector.h:24,
from ../public/tier1/utlbufferutil.h:17,
from ../tier1/utlbufferutil.cpp:11:
../public/tier0/memalloc.h: In function 'void* MemAlloc_AllocAligned(size_t, size_t)':
../public/tier0/memalloc.h:190:28: warning: cast from 'unsigned char*' to 'unsigned char**' increases required alignment of target type [-Wcast-align]
((unsigned char**)(pResult))[-1] = pAlloc;
^
../public/tier0/memalloc.h: In function 'void* MemAlloc_AllocAligned(size_t, size_t, const char*, int)':
../public/tier0/memalloc.h:208:28: warning: cast from 'unsigned char*' to 'unsigned char**' increases required alignment of target type [-Wcast-align]
((unsigned char**)(pResult))[-1] = pAlloc;
^
../public/tier0/memalloc.h: In function 'void* MemAlloc_AllocAlignedUnattributed(size_t, size_t)':
../public/tier0/memalloc.h:226:28: warning: cast from 'unsigned char*' to 'unsigned char**' increases required alignment of target type [-Wcast-align]
((unsigned char**)(pResult))[-1] = pAlloc;
^
../public/tier0/memalloc.h: In function 'void* MemAlloc_AllocAlignedFileLine(size_t, size_t, const char*, int)':
../public/tier0/memalloc.h:244:28: warning: cast from 'unsigned char*' to 'unsigned char**' increases required alignment of target type [-Wcast-align]
((unsigned char**)(pResult))[-1] = pAlloc;
^
In file included from ../tier1/utlbufferutil.cpp:17:0:
../public/Color.h: In constructor 'Color::Color()':
../public/Color.h:25:12: warning: cast from 'Color*' to 'int*' increases required alignment of target type [-Wcast-align]
*((int *)this) = 0;
^
../public/Color.h: In member function 'void Color::SetRawColor(int)':
../public/Color.h:59:12: warning: cast from 'Color*' to 'int*' increases required alignment of target type [-Wcast-align]
*((int *)this) = color32;
^
../public/Color.h: In member function 'int Color::GetRawColor() const':
../public/Color.h:64:19: warning: cast from 'const Color*' to 'int*' increases required alignment of target type [-Wcast-align]
return *((int *)this);
^
../public/Color.h: In member function 'bool Color::operator==(const Color&) const':
../public/Color.h:84:21: warning: cast from 'const Color*' to 'int*' increases required alignment of target type [-Wcast-align]
return ( *((int *)this) == *((int *)&rhs) );
^
../public/Color.h:84:40: warning: cast from 'const Color*' to 'int*' increases required alignment of target type [-Wcast-align]
return ( *((int *)this) == *((int *)&rhs) );
^
../tier1/utlbuffer.cpp:9:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
#pragma warning (disable : 4514)
^
../tier1/utlbuffer.cpp:908:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
#pragma warning ( disable : 4706 )
^
../tier1/utlbuffer.cpp:1079:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
#pragma warning ( default : 4706 )
^
In file included from ../public/mathlib/vector.h:32:0,
from ../public/mathlib/mathlib.h:14,
from ../public/tier1/utlmemory.h:20,
from ../public/tier1/utlbuffer.h:17,
from ../tier1/utlbuffer.cpp:11:
../public/tier0/threadtools.h: In member function 'bool CThreadSpinRWLock::AssignIf(const CThreadSpinRWLock::LockInfo_t&, const CThreadSpinRWLock::LockInfo_t&)':
../public/tier0/threadtools.h:1743:48: warning: cast from 'volatile CThreadSpinRWLock::LockInfo_t*' to 'int64* {aka long long int*}' increases required alignment of target type [-Wcast-align]
return ThreadInterlockedAssignIf64( (int64 *)&m_lockInfo, *((int64 *)&newValue), *((int64 *)&comperand) );
^
../public/tier0/threadtools.h:1743:72: warning: cast from 'const CThreadSpinRWLock::LockInfo_t*' to 'int64* {aka long long int*}' increases required alignment of target type [-Wcast-align]
return ThreadInterlockedAssignIf64( (int64 *)&m_lockInfo, *((int64 *)&newValue), *((int64 *)&comperand) );
^
../public/tier0/threadtools.h:1743:95: warning: cast from 'const CThreadSpinRWLock::LockInfo_t*' to 'int64* {aka long long int*}' increases required alignment of target type [-Wcast-align]
return ThreadInterlockedAssignIf64( (int64 *)&m_lockInfo, *((int64 *)&newValue), *((int64 *)&comperand) );
^
In file included from ../public/tier1/utlmemory.h:22:0,
from ../public/tier1/utlbuffer.h:17,
from ../tier1/utlbuffer.cpp:11:
../public/tier0/memalloc.h: In function 'void* MemAlloc_AllocAligned(size_t, size_t)':
../public/tier0/memalloc.h:190:28: warning: cast from 'unsigned char*' to 'unsigned char**' increases required alignment of target type [-Wcast-align]
((unsigned char**)(pResult))[-1] = pAlloc;
^
../public/tier0/memalloc.h: In function 'void* MemAlloc_AllocAligned(size_t, size_t, const char*, int)':
../public/tier0/memalloc.h:208:28: warning: cast from 'unsigned char*' to 'unsigned char**' increases required alignment of target type [-Wcast-align]
((unsigned char**)(pResult))[-1] = pAlloc;
^
../public/tier0/memalloc.h: In function 'void* MemAlloc_AllocAlignedUnattributed(size_t, size_t)':
../public/tier0/memalloc.h:226:28: warning: cast from 'unsigned char*' to 'unsigned char**' increases required alignment of target type [-Wcast-align]
((unsigned char**)(pResult))[-1] = pAlloc;
^
../public/tier0/memalloc.h: In function 'void* MemAlloc_AllocAlignedFileLine(size_t, size_t, const char*, int)':
../public/tier0/memalloc.h:244:28: warning: cast from 'unsigned char*' to 'unsigned char**' increases required alignment of target type [-Wcast-align]
((unsigned char**)(pResult))[-1] = pAlloc;
^
Waf: Leaving directory `/home/jusic/source-engine/build'
Build failed
-> task in 'tier0' failed with exit status 1 (run with -v to display more information)

10
public/filesystem_init.cpp

@ -341,14 +341,20 @@ bool FileSystem_GetExecutableDir( char *exedir, int exeDirLen ) @@ -341,14 +341,20 @@ bool FileSystem_GetExecutableDir( char *exedir, int exeDirLen )
Q_FixSlashes( exedir );
#ifdef ANDROID
const char* libDir = "lib";
#else
const char* libDir = "bin";
#endif
// Return the bin directory as the executable dir if it's not in there
// because that's really where we're running from...
char ext[MAX_PATH];
Q_StrRight( exedir, 4, ext, sizeof( ext ) );
if ( ext[0] != CORRECT_PATH_SEPARATOR || Q_stricmp( ext+1, "bin" ) != 0 )
if ( ext[0] != CORRECT_PATH_SEPARATOR || Q_stricmp( ext+1, libDir ) != 0 )
{
Q_strncat( exedir, CORRECT_PATH_SEPARATOR_S, exeDirLen, COPY_ALL_CHARACTERS );
Q_strncat( exedir, "bin", exeDirLen, COPY_ALL_CHARACTERS );
Q_strncat( exedir, libDir, exeDirLen, COPY_ALL_CHARACTERS );
Q_FixSlashes( exedir );
}

10
public/tier0/memoverride.cpp

@ -392,6 +392,8 @@ extern "C" @@ -392,6 +392,8 @@ extern "C"
#ifndef NO_MEMOVERRIDE_NEW_DELETE
#ifdef OSX
void *__cdecl operator new( size_t nSize ) throw (std::bad_alloc)
#elif ANDROID
void *__cdecl operator new( size_t nSize ) throw (std::bad_alloc)
#else
void *__cdecl operator new( size_t nSize )
#endif
@ -406,6 +408,8 @@ void *__cdecl operator new( size_t nSize, int nBlockUse, const char *pFileName, @@ -406,6 +408,8 @@ void *__cdecl operator new( size_t nSize, int nBlockUse, const char *pFileName,
#ifdef OSX
void __cdecl operator delete( void *pMem ) throw()
#elif ANDROID
void __cdecl operator delete( void *pMem ) throw()
#else
void __cdecl operator delete( void *pMem )
#endif
@ -415,6 +419,8 @@ void __cdecl operator delete( void *pMem ) @@ -415,6 +419,8 @@ void __cdecl operator delete( void *pMem )
#ifdef OSX
void operator delete(void*pMem, std::size_t)
#elif ANDROID
void operator delete(void*pMem, std::size_t)
#else
void operator delete(void*pMem, std::size_t) throw()
#endif
@ -424,6 +430,8 @@ void operator delete(void*pMem, std::size_t) throw() @@ -424,6 +430,8 @@ void operator delete(void*pMem, std::size_t) throw()
#ifdef OSX
void *__cdecl operator new[]( size_t nSize ) throw (std::bad_alloc)
#elif ANDROID
void *__cdecl operator new[]( size_t nSize ) throw (std::bad_alloc)
#else
void *__cdecl operator new[]( size_t nSize )
#endif
@ -438,6 +446,8 @@ void *__cdecl operator new[] ( size_t nSize, int nBlockUse, const char *pFileNam @@ -438,6 +446,8 @@ void *__cdecl operator new[] ( size_t nSize, int nBlockUse, const char *pFileNam
#ifdef OSX
void __cdecl operator delete[]( void *pMem ) throw()
#elif ANDROID
void __cdecl operator delete[]( void *pMem ) throw()
#else
void __cdecl operator delete[]( void *pMem )
#endif

4
scenefilecache/wscript vendored

@ -13,7 +13,7 @@ def options(opt): @@ -13,7 +13,7 @@ def options(opt):
def configure(conf):
conf.define('_WINDOWS',1) # WTF? this defined in original vpc file
conf.define('PROTECTED_THINGS_ENABLE',1)
#conf.define('PROTECTED_THINGS_ENABLE',1) # conflicts with stlport
def build(bld):
source = [
@ -30,7 +30,7 @@ def build(bld): @@ -30,7 +30,7 @@ def build(bld):
defines = []
libs = ['tier0','tier1']
libs = ['tier0','tier1','iconv']
install_path = bld.env.LIBDIR

BIN
scripts/waifulib/compiler_optimizations.pyc

Binary file not shown.

BIN
scripts/waifulib/fwgslib.pyc

Binary file not shown.

2
scripts/waifulib/reconfigure.py

@ -1,7 +1,9 @@ @@ -1,7 +1,9 @@
#!/usr/bin/env python
# encoding: utf-8
# Copyright (c) 2019 mittorn
CC=../android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc CXX=../android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc LD=../android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ld AR=../android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ar LINK=../android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ld STRIP=../android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-strip ./waf configure -T debug
../android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc -DDX_TO_GL_ABSTRACTION -DGL_GLEXT_PROTOTYPES -DBINK_VIDEO -DUSE_SDL=1 -DANDROID=1 -D_ANDROID=1 -DLINUX=1 -D_LINUX=1 -DPOSIX=1 -D_POSIX=1 -DGNUC -DNDEBUG -DNO_HOOK_MALLOC -D_DLL_EXT=.so /home/jusic/source-engine/main.c -c -o/home/jusic/source-engine/build/test.c.1.o
'''
Reconfigure

BIN
scripts/waifulib/xcompile.pyc

Binary file not shown.

2
soundemittersystem/wscript

@ -14,7 +14,7 @@ def options(opt): @@ -14,7 +14,7 @@ def options(opt):
def configure(conf):
conf.define('SOUNDEMITTERSYSTEM_EXPORTS',1)
conf.define('_WINDOWS',1)
conf.define('PROTECTED_THINGS_ENABLE',1)
#conf.define('PROTECTED_THINGS_ENABLE',1) # conflicts with stlport
#conf.define('fopen','dont_use_fopen') # WINDOWS
def build(bld):

2
studiorender/wscript

@ -14,7 +14,7 @@ def options(opt): @@ -14,7 +14,7 @@ def options(opt):
def configure(conf):
conf.env.append_unique('DEFINES',[
'STUDIORENDER_EXPORTS',
'PROTECTED_THINGS_ENABLE'
#'PROTECTED_THINGS_ENABLE' # conflicts with stlport
])
def build(bld):

2
tier0/assert_dialog.cpp

@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
#include <dlfcn.h>
#endif
#if defined( USE_SDL )
#if defined( LINUX ) || defined( USE_SDL )
// We lazily load the SDL shared object, and only reference functions if it's
// available, so this can be included on the dedicated server too.

12
tier0/dbg.cpp

@ -31,6 +31,10 @@ @@ -31,6 +31,10 @@
#include "xbox/xbox_console.h"
#endif
#ifdef ANDROID
#include <android/log.h>
#endif
#include "tier0/etwprof.h"
#ifndef STEAM
@ -313,6 +317,10 @@ static SpewRetval_t _SpewMessage( SpewType_t spewType, const char *pGroupName, i @@ -313,6 +317,10 @@ static SpewRetval_t _SpewMessage( SpewType_t spewType, const char *pGroupName, i
ret = s_SpewOutputFunc( spewType, pTempBuffer );
g_pSpewInfo = (int)NULL;
#ifdef ANDROID
__android_log_print( ANDROID_LOG_INFO, "SRCENGINE", "%s", pTempBuffer );
#endif
switch (ret)
{
// Asserts put the break into the macro so it occurs in the right place
@ -903,6 +911,10 @@ void COM_TimestampedLog( char const *fmt, ... ) @@ -903,6 +911,10 @@ void COM_TimestampedLog( char const *fmt, ... )
XBX_rTimeStampLog( curStamp, string );
#endif
#ifdef ANDROID
__android_log_print( ANDROID_LOG_INFO, "SRCENGINE", "%s", string );
#endif
if ( IsPC() )
{
// If ETW profiling is enabled then do it only.

3
tier0/platform_posix.cpp

@ -28,6 +28,9 @@ @@ -28,6 +28,9 @@
#include <time.h>
#include <fcntl.h>
#endif
#ifdef ANDROID
#include <linux/stat.h>
#endif
#include "tier0/memdbgon.h"
// Benchmark mode uses this heavy-handed method

5
tier0/threadtools.cpp

@ -23,8 +23,13 @@ @@ -23,8 +23,13 @@
#elif defined(POSIX)
#if !defined(OSX)
#if defined(ANDROID)
#include <fcntl.h>
#include <unistd.h>
#else
#include <sys/fcntl.h>
#include <sys/unistd.h>
#endif
#define sem_unlink( arg )
#define OS_TO_PTHREAD(x) (x)
#else

2
tier0/wscript

@ -65,7 +65,7 @@ def build(bld): @@ -65,7 +65,7 @@ def build(bld):
defines = []
libs = ['DL']
libs = ['DL', 'm', 'LOG']
install_path = bld.env.LIBDIR

19
tier1/interface.cpp

@ -304,14 +304,25 @@ CSysModule *Sys_LoadModule( const char *pModuleName, Sys_Flags flags /* = SYS_NO @@ -304,14 +304,25 @@ CSysModule *Sys_LoadModule( const char *pModuleName, Sys_Flags flags /* = SYS_NO
#ifdef POSIX
struct stat statBuf;
#ifdef ANDROID
Q_snprintf(szModuleName, sizeof(szModuleName), "lib/lib%s", pModuleName);
#else
Q_snprintf(szModuleName, sizeof(szModuleName), "bin/lib%s", pModuleName);
#endif
bUseLibPrefix |= stat(szModuleName, &statBuf) == 0;
#endif
if( bUseLibPrefix )
Q_snprintf( szAbsoluteModuleName, sizeof(szAbsoluteModuleName), "%s/bin/lib%s", szCwd, pModuleName );
else
Q_snprintf( szAbsoluteModuleName, sizeof(szAbsoluteModuleName), "%s/bin/%s", szCwd, pModuleName );
#ifdef ANDROID
char* szModulePath = "%s/lib/lib%s";
if (!bUseLibPrefix)
szModulePath = "%s/lib/%s";
#else
char* szModulePath = "%s/bin/lib%s";
if (!bUseLibPrefix)
szModulePath = "%s/bin/%s";
#endif
Q_snprintf( szAbsoluteModuleName, sizeof(szAbsoluteModuleName), szModulePath, szCwd, pModuleName );
hDLL = Sys_LoadLibrary( szAbsoluteModuleName, flags );
}

7
tier1/pathmatch.cpp

@ -750,7 +750,7 @@ extern "C" { @@ -750,7 +750,7 @@ extern "C" {
return CALL(freopen)( mpath, mode, stream );
}
#ifndef ANDROID
WRAP(fopen, FILE *, const char *path, const char *mode)
{
// if mode does not have w, a, or +, it's open for read.
@ -788,7 +788,7 @@ extern "C" { @@ -788,7 +788,7 @@ extern "C" {
{
return __wrap_open( pathname, O_CREAT|O_WRONLY|O_TRUNC, mode );
}
#endif
int __wrap_access(const char *pathname, int mode)
{
return __real_access( CWrap( pathname, false ), mode );
@ -815,6 +815,7 @@ extern "C" { @@ -815,6 +815,7 @@ extern "C" {
{
return CALL(opendir)( CWrap( name, false ) );
}
#ifndef ANDROID
WRAP(__xstat, int, int __ver, __const char *__filename, struct stat *__stat_buf)
{
@ -835,7 +836,7 @@ extern "C" { @@ -835,7 +836,7 @@ extern "C" {
{
return CALL(__lxstat64)( __ver, CWrap( __filename, false), __stat_buf );
}
#endif
WRAP(chmod, int, const char *path, mode_t mode)
{
return CALL(chmod)( CWrap( path, false), mode );

4
tier1/strtools.cpp

@ -47,7 +47,11 @@ @@ -47,7 +47,11 @@
#include <stdarg.h>
#ifdef POSIX
#ifdef ANDROID
#include <../thirdparty/libiconv-1.14/include/iconv.h>
#else
#include <iconv.h>
#endif
#include <ctype.h>
#include <unistd.h>
#include <stdlib.h>

4
tier1/wscript

@ -74,7 +74,9 @@ def build(bld): @@ -74,7 +74,9 @@ def build(bld):
defines = []
libs = []
libs = [
'libgnustl_static.a'
]
bld.stlib(
source = source,

4
togl/linuxwin/glentrypoints.cpp

@ -43,7 +43,7 @@ @@ -43,7 +43,7 @@
#include "tier1.h"
#include "tier2/tier2.h"
#ifdef _LINUX
#if defined(_LINUX) && !defined(__ANDROID__)
#include <GL/glx.h>
#endif
@ -296,7 +296,7 @@ static bool CheckOpenGLExtension_internal(const char *ext, const int coremajor, @@ -296,7 +296,7 @@ static bool CheckOpenGLExtension_internal(const char *ext, const int coremajor,
return false;
}
}
#elif !defined ( OSX )
#elif !defined ( OSX ) && !defined( __ANDROID__ )
if (!ptr)
{
static CDynamicFunctionOpenGL< true, Display *( APIENTRY *)( ), Display* > glXGetCurrentDisplay("glXGetCurrentDisplay");

1
togl/wscript

@ -13,7 +13,6 @@ def options(opt): @@ -13,7 +13,6 @@ def options(opt):
def configure(conf):
conf.define('TOGL_DLL_EXPORT',1)
conf.define('PROTECTED_THINGS_ENABLE',1)
conf.env.append_unique('DEFINES',['strncpy=use_Q_strncpy_instead',
'_snprintf=use_Q_snprintf_instead'])

2
vgui2/src/wscript

@ -50,7 +50,7 @@ def build(bld): @@ -50,7 +50,7 @@ def build(bld):
defines = []
libs = ['tier0','tier1','tier2','tier3','vstdlib','SDL2']
libs = ['tier0','tier1','tier2','tier3','vstdlib','sdl2']
install_path = bld.env.LIBDIR

4
vgui2/vgui_surfacelib/wscript

@ -31,7 +31,9 @@ def build(bld): @@ -31,7 +31,9 @@ def build(bld):
'../../public',
'../../public/tier0',
'../../public/tier1',
'../../common'
'../../common',
'../../thirdparty/freetype2-android/include', # [$ANDROID]
'../../thirdparty/fontconfig' # [$ANDROID]
] + bld.env.INCLUDES_FT2
defines = []

8
vguimatsurface/wscript

@ -15,7 +15,7 @@ def configure(conf): @@ -15,7 +15,7 @@ def configure(conf):
conf.define('VGUIMATSURFACE_DLL_EXPORT',1)
conf.define('GAMEUI_EXPORTS',1)
conf.define('DONT_PROTECT_FILEIO_FUNCTIONS',1)
conf.define('PROTECTED_THINGS_ENABLE',1)
#conf.define('PROTECTED_THINGS_ENABLE',1) # conflicts with stlport
def build(bld):
@ -38,12 +38,14 @@ def build(bld): @@ -38,12 +38,14 @@ def build(bld):
'../public',
'../public/tier0',
'../public/tier1',
'../common'
'../common',
'../../thirdparty/freetype2-android/include', # [$ANDROID]
'../../thirdparty/fontconfig' # [$ANDROID]
] + bld.env.INCLUDES_SDL2 + bld.env.INCLUDES_FREETYPE
defines = []
libs = ['bitmap','mathlib','tier0','vgui_controls','tier1','vstdlib','tier2','tier3','vgui_surfacelib','FT2','FC','SDL2']
libs = ['bitmap','mathlib','tier0','vgui_controls','tier1','vstdlib','tier2','tier3','vgui_surfacelib','FT2','FC','sdl2','EXPAT']
install_path = bld.env.LIBDIR

2
vstdlib/wscript

@ -38,7 +38,7 @@ def build(bld): @@ -38,7 +38,7 @@ def build(bld):
defines = []
libs = ['tier0','tier1']
libs = ['tier0','tier1','iconv']
install_path = bld.env.LIBDIR

8
wafandroid

@ -0,0 +1,8 @@ @@ -0,0 +1,8 @@
export CC=/home/jusic/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc
export CXX=/home/jusic/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc
export LD=/home/jusic/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ld
export AR=/home/jusic/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ar
export LINK=/home/jusic/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ld
export STRIP=/home/jusic/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-strip
export OBJCOPY=/home/jusic/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-objcopy
./waf configure -T debug

48
wscript

@ -226,19 +226,19 @@ def configure(conf): @@ -226,19 +226,19 @@ def configure(conf):
conf.load('force_32bit')
if conf.options.SDL:
conf.check_cfg(package='sdl2', uselib_store='SDL2', args=['--cflags', '--libs'])
#if conf.options.SDL:
# conf.check_cfg(package='sdl2', uselib_store='SDL2', args=['--cflags', '--libs'])
if conf.options.DEDICATED:
conf.check_cfg(package='libedit', uselib_store='EDIT', args=['--cflags', '--libs'])
else:
conf.check_pkg('freetype2', 'FT2', FT2_CHECK)
conf.check_pkg('fontconfig', 'FC', FC_CHECK)
conf.check_cfg(package='openal', uselib_store='OPENAL', args=['--cflags', '--libs'])
conf.check_cfg(package='libjpeg', uselib_store='JPEG', args=['--cflags', '--libs'])
conf.check_cfg(package='libpng', uselib_store='PNG', args=['--cflags', '--libs'])
conf.check_cfg(package='libcurl', uselib_store='CURL', args=['--cflags', '--libs'])
#else:
#conf.check_pkg('freetype2', 'FT2', FT2_CHECK)
#conf.check_pkg('fontconfig', 'FC', FC_CHECK)
#conf.check_cfg(package='openal', uselib_store='OPENAL', args=['--cflags', '--libs'])
#conf.check_cfg(package='libjpeg', uselib_store='JPEG', args=['--cflags', '--libs'])
#conf.check_cfg(package='libpng', uselib_store='PNG', args=['--cflags', '--libs'])
#conf.check_cfg(package='libcurl', uselib_store='CURL', args=['--cflags', '--libs'])
conf.check_cfg(package='zlib', uselib_store='ZLIB', args=['--cflags', '--libs'])
#conf.check_cfg(package='zlib', uselib_store='ZLIB', args=['--cflags', '--libs'])
compiler_optional_flags = [
'-Wall',
@ -247,11 +247,13 @@ def configure(conf): @@ -247,11 +247,13 @@ def configure(conf):
'-Wuninitialized',
'-Winit-self',
'-Wstrict-aliasing',
'-faligned-new'
'-Wextra',
'-w',
#'-faligned-new'
]
c_compiler_optional_flags = [
'-fnonconst-initializers' # owcc
#'-fnonconst-initializers' # owcc
]
cflags, linkflags = conf.get_optimization_flags()
@ -259,10 +261,12 @@ def configure(conf): @@ -259,10 +261,12 @@ def configure(conf):
flags = ['-fPIC']
if conf.env.DEST_CPU == 'arm':
flags += ['-mfpu=neon', '-fsigned-char']
flags += ['-mfpu=neon', '-mfloat-abi=softfp', '-fsigned-char', '--sysroot=/home/jusic/android-ndk-r10e/platforms/android-21/arch-arm', '-I/home/jusic/android-ndk-r10e/sources/cxx-stl/stlport/stlport', '-I/home/jusic/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a-hard/include', '-I/home/jusic/android-ndk-r10e/sources/android/support/include']
else:
flags += ['-march=pentium4','-mtune=core2','-mfpmath=387']
flags += ['-I/home/jusic/source-engine-android/thirdparty/SDL/include', '-L/home/jusic/android-ndk-r10e/sources/cxx-stl/stlport/libs/armeabi-v7a-hard/thumb', '-L/home/jusic/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9', '-lstlport_shared', '-lm', '-L/home/jusic/source-engine-android/lib/common/android/armeabi-v7a', '-L/home/jusic/source-engine-android/lib/public/android/armeabi-v7a']
cflags += flags
linkflags += flags
@ -270,7 +274,7 @@ def configure(conf): @@ -270,7 +274,7 @@ def configure(conf):
cxxflags = list(cflags) + ['-std=c++11','-fpermissive']
if conf.env.COMPILER_CC == 'gcc':
wrapfunctions = ['freopen','fopen','open','creat','access','__xstat','stat','lstat','fopen64','open64',
wrapfunctions = ['freopen','creat','access','__xstat','stat','lstat','fopen64','open64',
'opendir','__lxstat','chmod','chown','lchown','symlink','link','__lxstat64','mknod',
'utimes','unlink','rename','utime','__xstat64','mount','mkfifo','mkdir','rmdir','scandir','realpath']
@ -284,6 +288,7 @@ def configure(conf): @@ -284,6 +288,7 @@ def configure(conf):
conf.check_cxx(cxxflags=cxxflags, linkflags=linkflags, msg='Checking for required C++ flags')
linkflags += ['-pthread']
conf.env.append_unique('CFLAGS', cflags)
conf.env.append_unique('CXXFLAGS', cxxflags)
conf.env.append_unique('LINKFLAGS', linkflags)
@ -291,11 +296,26 @@ def configure(conf): @@ -291,11 +296,26 @@ def configure(conf):
cxxflags += conf.filter_cxxflags(compiler_optional_flags, cflags)
cflags += conf.filter_cflags(compiler_optional_flags + c_compiler_optional_flags, cflags)
conf.env.append_unique('CFLAGS', cflags)
conf.env.append_unique('CXXFLAGS', cxxflags)
conf.env.append_unique('LINKFLAGS', linkflags)
conf.env.append_unique('INCLUDES', [os.path.abspath('common/')])
conf.check(lib='iconv', uselib_store='iconv')
conf.check(lib='curl', uselib_store='curl')
conf.check(lib='jpeg', uselib_store='jpeg')
conf.check(lib='z', uselib_store='zlib')
conf.check(lib='crypto', uselib_store='crypto')
conf.check(lib='ssl', uselib_store='ssl')
conf.check(lib='openal', uselib_store='openal')
conf.check(lib='SDL2', uselib_store='sdl2')
conf.check(lib='png', uselib_store='png')
conf.check(lib='fontconfig', uselib_store='FT2')
conf.check(lib='freetype2', uselib_store='FC')
conf.check(lib='expat', uselib_store='EXPAT')
conf.check(lib='log', uselib_store='LOG')
if conf.env.DEST_OS != 'win32':
conf.check_cc(lib='dl', mandatory=False)
conf.check_cc(lib='bz2', mandatory=False)

Loading…
Cancel
Save