From af3ceed85149b7a588d15c385518c048dbaf4a86 Mon Sep 17 00:00:00 2001 From: JusicP Date: Sat, 21 Aug 2021 15:18:30 +0300 Subject: [PATCH] Upload --- .gitignore | 2 - appframework/sdlmgr.cpp | 12 + common/freetype/config/ftconfig.h | 4 + common/sse2neon.h | 15 +- datacache/wscript | 2 +- engine/sys_dll2.cpp | 8 + engine/wscript | 7 +- filesystem/basefilesystem.cpp | 10 +- filesystem/filesystem_stdio.cpp | 4 + game/client/mumble.cpp | 2 + gameui/wscript | 2 +- inputsystem/wscript | 2 +- launcher/launcher.cpp | 304 +++++++++++++++++++- launcher/wscript | 2 +- launcher_main/main.cpp | 1 + launcher_main/wscript | 2 +- materialsystem/shaderapidx9/wscript | 4 +- materialsystem/stdshaders/wscript | 2 +- materialsystem/wscript | 2 +- output | 285 ++++++++++++++++++ public/filesystem_init.cpp | 10 +- public/tier0/memoverride.cpp | 10 + scenefilecache/wscript | 4 +- scripts/waifulib/compiler_optimizations.pyc | Bin 0 -> 4663 bytes scripts/waifulib/fwgslib.pyc | Bin 0 -> 5667 bytes scripts/waifulib/reconfigure.py | 2 + scripts/waifulib/xcompile.pyc | Bin 0 -> 15030 bytes soundemittersystem/wscript | 2 +- studiorender/wscript | 2 +- tier0/assert_dialog.cpp | 2 +- tier0/dbg.cpp | 12 + tier0/platform_posix.cpp | 3 + tier0/threadtools.cpp | 5 + tier0/wscript | 2 +- tier1/interface.cpp | 19 +- tier1/pathmatch.cpp | 7 +- tier1/strtools.cpp | 4 + tier1/wscript | 4 +- togl/linuxwin/glentrypoints.cpp | 4 +- togl/wscript | 1 - vgui2/src/wscript | 2 +- vgui2/vgui_surfacelib/wscript | 4 +- vguimatsurface/wscript | 8 +- vstdlib/wscript | 2 +- wafandroid | 8 + wscript | 52 ++-- 46 files changed, 766 insertions(+), 75 deletions(-) create mode 100644 output create mode 100644 scripts/waifulib/compiler_optimizations.pyc create mode 100644 scripts/waifulib/fwgslib.pyc create mode 100644 scripts/waifulib/xcompile.pyc create mode 100755 wafandroid diff --git a/.gitignore b/.gitignore index 41099b16..1684afe3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,7 @@ *.mak *.mak.vpc_crc *.vpc_crc -*.a *.project -lib/ *obj_* build/ .waf* diff --git a/appframework/sdlmgr.cpp b/appframework/sdlmgr.cpp index 7234f4d1..f9bb6866 100644 --- a/appframework/sdlmgr.cpp +++ b/appframework/sdlmgr.cpp @@ -475,13 +475,25 @@ 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 } 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") ) diff --git a/common/freetype/config/ftconfig.h b/common/freetype/config/ftconfig.h index 8d4a074b..5e19c414 100644 --- a/common/freetype/config/ftconfig.h +++ b/common/freetype/config/ftconfig.h @@ -1,7 +1,11 @@ #ifndef __FTCONFIG_H__MULTILIB #define __FTCONFIG_H__MULTILIB +#ifdef ANDROID +#include +#else #include +#endif #if __WORDSIZE == 32 # include "ftconfig-32.h" diff --git a/common/sse2neon.h b/common/sse2neon.h index 9e512acf..8474e9ef 100644 --- a/common/sse2neon.h +++ b/common/sse2neon.h @@ -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 diff --git a/datacache/wscript b/datacache/wscript index 81bd128f..fe0e2022 100755 --- a/datacache/wscript +++ b/datacache/wscript @@ -33,7 +33,7 @@ def build(bld): defines = [] - libs = ['tier0','tier1','tier2','tier3'] + libs = ['tier0','tier1','tier2','tier3','iconv'] install_path = bld.env.LIBDIR diff --git a/engine/sys_dll2.cpp b/engine/sys_dll2.cpp index e6742211..bce0f923 100644 --- a/engine/sys_dll2.cpp +++ b/engine/sys_dll2.cpp @@ -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 */ ) diff --git a/engine/wscript b/engine/wscript index 0e48ae14..1fa9dbf3 100755 --- a/engine/wscript +++ b/engine/wscript @@ -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 diff --git a/filesystem/basefilesystem.cpp b/filesystem/basefilesystem.cpp index 4423cb4c..4bd5dfbd 100644 --- a/filesystem/basefilesystem.cpp +++ b/filesystem/basefilesystem.cpp @@ -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 { #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 #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 diff --git a/filesystem/filesystem_stdio.cpp b/filesystem/filesystem_stdio.cpp index 43916fe3..3bb7c5b5 100644 --- a/filesystem/filesystem_stdio.cpp +++ b/filesystem/filesystem_stdio.cpp @@ -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 ); diff --git a/game/client/mumble.cpp b/game/client/mumble.cpp index 8e58bc22..9d16acc5 100644 --- a/game/client/mumble.cpp +++ b/game/client/mumble.cpp @@ -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() ); diff --git a/gameui/wscript b/gameui/wscript index d508bbd9..a37190c0 100755 --- a/gameui/wscript +++ b/gameui/wscript @@ -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 diff --git a/inputsystem/wscript b/inputsystem/wscript index fe090fbf..680bb5d0 100755 --- a/inputsystem/wscript +++ b/inputsystem/wscript @@ -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 diff --git a/launcher/launcher.cpp b/launcher/launcher.cpp index d34ae113..2c11f0b3 100644 --- a/launcher/launcher.cpp +++ b/launcher/launcher.cpp @@ -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 +#include "jni.h" +#endif + // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" @@ -680,8 +685,7 @@ 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() 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() 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() // 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 @@ -1229,7 +1523,7 @@ DLL_EXPORT int LauncherMain( int argc, char **argv ) { return -1; } - + const char *filename; #ifdef WIN32 CommandLine()->CreateCmdLine( IsPC() ? VCRHook_GetCommandLine() : lpCmdLine ); diff --git a/launcher/wscript b/launcher/wscript index 7af6dd6b..2dceef8f 100755 --- a/launcher/wscript +++ b/launcher/wscript @@ -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 diff --git a/launcher_main/main.cpp b/launcher_main/main.cpp index 1fca6b10..90aafcc3 100644 --- a/launcher_main/main.cpp +++ b/launcher_main/main.cpp @@ -146,6 +146,7 @@ int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdL #if defined( LINUX ) #include +#include static bool IsDebuggerPresent( int time ) { diff --git a/launcher_main/wscript b/launcher_main/wscript index 622952bc..37f52564 100755 --- a/launcher_main/wscript +++ b/launcher_main/wscript @@ -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'] diff --git a/materialsystem/shaderapidx9/wscript b/materialsystem/shaderapidx9/wscript index 168d8539..21c89915 100755 --- a/materialsystem/shaderapidx9/wscript +++ b/materialsystem/shaderapidx9/wscript @@ -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): defines = [] - libs = ['tier0','tier1','tier2','vstdlib','togl','bitmap','mathlib'] + libs = ['tier0','tier1','tier2','vstdlib','togl','bitmap','mathlib','iconv'] install_path = bld.env.LIBDIR diff --git a/materialsystem/stdshaders/wscript b/materialsystem/stdshaders/wscript index c4a82640..a5f6073e 100644 --- a/materialsystem/stdshaders/wscript +++ b/materialsystem/stdshaders/wscript @@ -148,7 +148,7 @@ def build(bld): defines = [] - libs = ['tier0','shaderlib','tier1','mathlib'] + libs = ['tier0','shaderlib','tier1','mathlib','iconv'] install_path = bld.env.LIBDIR diff --git a/materialsystem/wscript b/materialsystem/wscript index 4bb7d2f8..a99fb804 100755 --- a/materialsystem/wscript +++ b/materialsystem/wscript @@ -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' ]) diff --git a/output b/output new file mode 100644 index 00000000..6006933b --- /dev/null +++ b/output @@ -0,0 +1,285 @@ + + + + + + + +Build commands will be stored in build/compile_commands.json +Waf: Entering directory `/home/jusic/source-engine/build' + + + + + + + +[ 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) diff --git a/public/filesystem_init.cpp b/public/filesystem_init.cpp index d6126578..10006487 100644 --- a/public/filesystem_init.cpp +++ b/public/filesystem_init.cpp @@ -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 ); } diff --git a/public/tier0/memoverride.cpp b/public/tier0/memoverride.cpp index 925f9d2a..c0f8e2af 100644 --- a/public/tier0/memoverride.cpp +++ b/public/tier0/memoverride.cpp @@ -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, #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 ) #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() #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 #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 diff --git a/scenefilecache/wscript b/scenefilecache/wscript index a63db9a9..b9205736 100755 --- a/scenefilecache/wscript +++ b/scenefilecache/wscript @@ -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): defines = [] - libs = ['tier0','tier1'] + libs = ['tier0','tier1','iconv'] install_path = bld.env.LIBDIR diff --git a/scripts/waifulib/compiler_optimizations.pyc b/scripts/waifulib/compiler_optimizations.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a7c091c85462d8201847e514bc3c1458ff48a91e GIT binary patch literal 4663 zcmcInOH&-l5zZb!Fo>64XwhTU!j{FZX-4Sj#midKfMjB4K`|i7i^DO|Om#O6J>3&s z)gU(3C)pRD{2zSw#V7v?pB?@iKKfvPnbpG#T8Hg}SBj~w%FN2l$~QxQpB(>FeadfB z`EMHEr}*iARESQlks?wKB}5&Eb{*+mj#DCs&LUHXe!-XuCBxJiq1_P@ z${|Y5QD>BPM{yn|HA3nfsZmm6q^hLGDFSYc;tIt>q|Q_1keZ;!YEpJn*iFlB2D=ON z7MeJJ=NrM*)dDIg9&%f3(e|(q?zCtQeT|j{u!yKJrnN20MF<*M7vX@ zp37#M0@%9F`}YX)8B%Msy|9iXi2sRy3rGYq7qCQuX@!X&>DJy!%baurbLB&5JL`1g zB*+&WzBG)bouy&_)W{-j#sLm}ZBpOFM}biB(ToC~2T9=Tz>Hw8g1sUV>NLx`Cho-F z1ZE5f?WeKf0}DvAG|=a;sjaO)fBjNm9evc+7XkC$CX1ezW?qr1AdJ&MnIV9qc3ZRV zjAqVR>T2V+4_6;8-#-)%*>SsVm@8h?$x?lpsl%S&)l+s>N+01Xl?Pgj{_Vt1Be_{y zYrWpy*nHV~v%Gw-wY~P`ljW9XMQXdT{l3`Nm*m`DG5dMot8G6FHt<2H> zRr#o6KM%e8a>)yiVjb_rNo-D5_hY4kRC68kLOfjWXSwl$wCLzbfrUxtgR9A)C#&E^ z53Go-`{nnCJy${6d-WK~#Ul-m*s-d>m@y)(hdJH~> z`Oe}KxbrMtd=C%#MPjU;9Y1gHui6mN9|`wf40w2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Q0|%zcIuXQ$A!8MP(1mp~&|37c=r9e@c0u{{iIB1ODNCOtgc?Fw&`J&6`88 zZus9u*q-rjc!GK2eHchS#S4%NoF6@Q+17gm@W>4ur0Z~ltK)9)kZy1=qn-f#$lx4) z*{}(%oKKX177{SueIuCV6k!rwFeNa-P6UD@q6tQKl-0$QLtD+^Si#o+0pEnm*oE_D z1>B}848Jn;6)2DE6%5rft)}27{2|UoAQ}D$HGxso=UrT|7Cu0uW7D6on@1|kxs(Re zIdBQES2-5XnR7xW1eM#EL%bL|5^oGMouo68&w+s~_UUB`dr&_^QBX8hnOu zO`ug!9%<7PzGT7=zC<|0cN9s#fiU4qPaQ0&O*C&vLT1+A2q`#L5g1(X({>6hl~=`z zD~n(~&vcNsgDkH`#jWPcqjn=8QG-T|?z#^JxRfKqB`6o~-E;12-dhZKd*gkyi)22? z`xaOHb70)%3P4{=xx?=tBVK$({gMa;8^MB8W2C{+((%$C?*{nTLaTr#aZv8Au~dFA zBjc6&3R`iUV9fNpsTI0$$rNE2K4S4x6z2jrUUUR*?(jaxtGl93UGnPkIpc=6Aol=9 z^4xvXa}i3Y+qn<>Lc%e8%z~GKkgyGJvADzHE{l6CR!|7zgU5yCnUN#J$+y9X=Uc`* z%al^WVA&9UpYo*N@E0sTKrym{)XtDRPhqx)y*wFo_50Mo+(t3&-S(&Fr)RIsO?a1T Re5Px2-kk5s=C$Uv{{q)CL@NLQ literal 0 HcmV?d00001 diff --git a/scripts/waifulib/reconfigure.py b/scripts/waifulib/reconfigure.py index 5c130422..5a122341 100644 --- a/scripts/waifulib/reconfigure.py +++ b/scripts/waifulib/reconfigure.py @@ -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 diff --git a/scripts/waifulib/xcompile.pyc b/scripts/waifulib/xcompile.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0011ff375bffb4b39fc0d66e559e1e371f3fabcc GIT binary patch literal 15030 zcmcgz-ESP%b-%OAucb(lq9jVx=Sa3ib|w3hKv>|QZ$VNq;1;1~_d(US7XL#_h3x~b3O8@oY`)z#m-&#sNI;MQ3d`nf8s#$8) zQr7+Ggt9Cvt!^s z?p4)6wK^!1A%94%9#Vdv^83|#My(Dhe?a*;MX`CJ)#_2@A5j%7a!h@s)KjItwu=27WnuNW@{dVoT=~Z( zb3*y!k~t~MIw4z_P^%NFc1o?DQdV$U1ry3Ysh(nuXB3O4TE(-Zzstmk1jf z^MCba<@c)6I;Ob93BLS+?mkssGXzs;2F@(w4o{iN9HfC|7BgOY-sEFlAUDI*zhQC2cwm>$W1WqKt8cIuPN5pp09O#T^=%uzza ze=yfapgP!RQ0l=xha>~`8Ilax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+(4~u+&n>Np zE9W&3`0oQ}u+YT3FoJ;6QPixUnOKYJejq@BVu8iOvvV*~lx&KHfU2nn=IT1<_-*ox zh|hk8$&KPIY#5(WYmzqsvYN`nb&VA{D4UT5bdHTZ!bLa>OlXuiw1AxpOlXxlzs|&G@)DC*n2>#qvZ7!T zAtI;F`2!aJ5Q(fGzuyoF{)n}I%;b-l{0WmkMPfD?cnmH#1gpTJc0tPx+`se2c`X1R z1!;}*SE%U_MRG6V#0~)5O>>`fi&szjZ6sNB%;JZ?5#YTLLxM)y_Z+9KzU #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. diff --git a/tier0/dbg.cpp b/tier0/dbg.cpp index ce01801f..9bbe1348 100644 --- a/tier0/dbg.cpp +++ b/tier0/dbg.cpp @@ -31,6 +31,10 @@ #include "xbox/xbox_console.h" #endif +#ifdef ANDROID +#include +#endif + #include "tier0/etwprof.h" #ifndef STEAM @@ -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, ... ) 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. diff --git a/tier0/platform_posix.cpp b/tier0/platform_posix.cpp index ba2783a5..9a12bc3b 100644 --- a/tier0/platform_posix.cpp +++ b/tier0/platform_posix.cpp @@ -28,6 +28,9 @@ #include #include #endif +#ifdef ANDROID +#include +#endif #include "tier0/memdbgon.h" // Benchmark mode uses this heavy-handed method diff --git a/tier0/threadtools.cpp b/tier0/threadtools.cpp index caafef6c..99da9d66 100644 --- a/tier0/threadtools.cpp +++ b/tier0/threadtools.cpp @@ -23,8 +23,13 @@ #elif defined(POSIX) #if !defined(OSX) +#if defined(ANDROID) + #include + #include +#else #include #include +#endif #define sem_unlink( arg ) #define OS_TO_PTHREAD(x) (x) #else diff --git a/tier0/wscript b/tier0/wscript index 9f6e39bb..72841393 100755 --- a/tier0/wscript +++ b/tier0/wscript @@ -65,7 +65,7 @@ def build(bld): defines = [] - libs = ['DL'] + libs = ['DL', 'm', 'LOG'] install_path = bld.env.LIBDIR diff --git a/tier1/interface.cpp b/tier1/interface.cpp index 3c91cc30..45ba5c90 100644 --- a/tier1/interface.cpp +++ b/tier1/interface.cpp @@ -304,15 +304,26 @@ 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 ); } diff --git a/tier1/pathmatch.cpp b/tier1/pathmatch.cpp index bd8d3cbd..8e439dfe 100644 --- a/tier1/pathmatch.cpp +++ b/tier1/pathmatch.cpp @@ -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" { { 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" { { 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" { { 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 ); diff --git a/tier1/strtools.cpp b/tier1/strtools.cpp index cfef6b13..09a95cba 100644 --- a/tier1/strtools.cpp +++ b/tier1/strtools.cpp @@ -47,7 +47,11 @@ #include #ifdef POSIX +#ifdef ANDROID +#include <../thirdparty/libiconv-1.14/include/iconv.h> +#else #include +#endif #include #include #include diff --git a/tier1/wscript b/tier1/wscript index c8a8673e..e381ecf4 100755 --- a/tier1/wscript +++ b/tier1/wscript @@ -74,7 +74,9 @@ def build(bld): defines = [] - libs = [] + libs = [ + 'libgnustl_static.a' + ] bld.stlib( source = source, diff --git a/togl/linuxwin/glentrypoints.cpp b/togl/linuxwin/glentrypoints.cpp index 25e49ab3..fad300d7 100644 --- a/togl/linuxwin/glentrypoints.cpp +++ b/togl/linuxwin/glentrypoints.cpp @@ -43,7 +43,7 @@ #include "tier1.h" #include "tier2/tier2.h" -#ifdef _LINUX +#if defined(_LINUX) && !defined(__ANDROID__) #include #endif @@ -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"); diff --git a/togl/wscript b/togl/wscript index bdce47f3..ab31edfe 100755 --- a/togl/wscript +++ b/togl/wscript @@ -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']) diff --git a/vgui2/src/wscript b/vgui2/src/wscript index f4e5547c..02599257 100644 --- a/vgui2/src/wscript +++ b/vgui2/src/wscript @@ -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 diff --git a/vgui2/vgui_surfacelib/wscript b/vgui2/vgui_surfacelib/wscript index 44dc4e78..5d5cf846 100644 --- a/vgui2/vgui_surfacelib/wscript +++ b/vgui2/vgui_surfacelib/wscript @@ -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 = [] diff --git a/vguimatsurface/wscript b/vguimatsurface/wscript index 90ebb812..220501ec 100644 --- a/vguimatsurface/wscript +++ b/vguimatsurface/wscript @@ -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): '../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 diff --git a/vstdlib/wscript b/vstdlib/wscript index 730ab25c..855ffb28 100755 --- a/vstdlib/wscript +++ b/vstdlib/wscript @@ -38,7 +38,7 @@ def build(bld): defines = [] - libs = ['tier0','tier1'] + libs = ['tier0','tier1','iconv'] install_path = bld.env.LIBDIR diff --git a/wafandroid b/wafandroid new file mode 100755 index 00000000..25b6acd3 --- /dev/null +++ b/wafandroid @@ -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 diff --git a/wscript b/wscript index ab1bcf05..9803fe36 100644 --- a/wscript +++ b/wscript @@ -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): '-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,18 +261,20 @@ 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 - - # And here C++ flags starts to be treated separately + + # And here C++ flags starts to be treated separately 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): 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): 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)