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 00000000..a7c091c8 Binary files /dev/null and b/scripts/waifulib/compiler_optimizations.pyc differ diff --git a/scripts/waifulib/fwgslib.pyc b/scripts/waifulib/fwgslib.pyc new file mode 100644 index 00000000..dd6ac017 Binary files /dev/null and b/scripts/waifulib/fwgslib.pyc differ 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 00000000..0011ff37 Binary files /dev/null and b/scripts/waifulib/xcompile.pyc differ diff --git a/soundemittersystem/wscript b/soundemittersystem/wscript index 36e1e413..3da4b83a 100755 --- a/soundemittersystem/wscript +++ b/soundemittersystem/wscript @@ -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): diff --git a/studiorender/wscript b/studiorender/wscript index 9d55719e..2e6d7b5c 100755 --- a/studiorender/wscript +++ b/studiorender/wscript @@ -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): diff --git a/tier0/assert_dialog.cpp b/tier0/assert_dialog.cpp index e13b47e0..419d2a6d 100644 --- a/tier0/assert_dialog.cpp +++ b/tier0/assert_dialog.cpp @@ -23,7 +23,7 @@ #include #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)