mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
engine: drop dllemu glue, as it won't build with current engine anyway and not supported by it's author :(
This commit is contained in:
@@ -337,9 +337,6 @@ typedef struct host_parm_s
|
||||
qboolean apply_game_config; // when true apply only to game cvars and ignore all other commands
|
||||
qboolean apply_opengl_config; // when true apply only to opengl cvars and ignore all other commands
|
||||
qboolean config_executed; // a bit who indicated was config.cfg already executed e.g. from valve.rc
|
||||
#if XASH_DLL_LOADER
|
||||
qboolean enabledll;
|
||||
#endif
|
||||
qboolean textmode;
|
||||
|
||||
// some settings were changed and needs to global update
|
||||
|
||||
@@ -1038,10 +1038,6 @@ static void Host_InitCommon( int argc, char **argv, const char *progname, qboole
|
||||
if( !Sys_CheckParm( "-noch" ))
|
||||
Sys_SetupCrashHandler( argv[0] );
|
||||
|
||||
#if XASH_DLL_LOADER
|
||||
host.enabledll = !Sys_CheckParm( "-nodll" );
|
||||
#endif
|
||||
|
||||
host.change_game = bChangeGame || Sys_CheckParm( "-changegame" );
|
||||
host.config_executed = false;
|
||||
host.status = HOST_INIT; // initialzation started
|
||||
|
||||
@@ -15,39 +15,8 @@ GNU General Public License for more details.
|
||||
|
||||
#include "platform/platform.h"
|
||||
#include "library.h"
|
||||
|
||||
#if XASH_LIB == LIB_STATIC
|
||||
#ifdef XASH_NO_LIBDL
|
||||
|
||||
void *dlsym(void *handle, const char *symbol )
|
||||
{
|
||||
Con_DPrintf( "%s( %p, \"%s\" ): stub\n", __func__, handle, symbol );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void *dlopen(const char *name, int flag )
|
||||
{
|
||||
Con_DPrintf( "%s( \"%s\", %d ): stub\n", __func__, name, flag );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int dlclose(void *handle)
|
||||
{
|
||||
Con_DPrintf( "%s( %p ): stub\n", __func__, handle );
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *dlerror( void )
|
||||
{
|
||||
return "Loading ELF libraries not supported in this build!\n";
|
||||
}
|
||||
|
||||
int dladdr( const void *addr, void *info )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif // XASH_NO_LIBDL
|
||||
|
||||
|
||||
typedef struct table_s
|
||||
{
|
||||
const char *name;
|
||||
@@ -98,4 +67,4 @@ const char *COM_NameForFunction( void *hInstance, void *function )
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
#endif // XASH_LIB == LIB_STATIC
|
||||
|
||||
@@ -27,34 +27,20 @@ GNU General Public License for more details.
|
||||
#include "platform/android/lib_android.h"
|
||||
#include "platform/apple/lib_ios.h"
|
||||
|
||||
#ifdef XASH_DLL_LOADER // wine-based dll loader
|
||||
void * Loader_LoadLibrary (const char *name);
|
||||
void * Loader_GetProcAddress (void *hndl, const char *name);
|
||||
void Loader_FreeLibrary(void *hndl);
|
||||
void *Loader_GetDllHandle( void *hndl );
|
||||
const char * Loader_GetFuncName( void *hndl, void *func);
|
||||
const char * Loader_GetFuncName_int( void *wm , void *func);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef XASH_NO_LIBDL
|
||||
#ifndef XASH_DLL_LOADER
|
||||
#error Enable at least one dll backend!!!
|
||||
#endif // XASH_DLL_LOADER
|
||||
|
||||
void *dlsym(void *handle, const char *symbol )
|
||||
void *dlsym( void *handle, const char *symbol )
|
||||
{
|
||||
Con_DPrintf( "%s( %p, \"%s\" ): stub\n", __func__, handle, symbol );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void *dlopen(const char *name, int flag )
|
||||
void *dlopen( const char *name, int flag )
|
||||
{
|
||||
Con_DPrintf( "%s( \"%s\", %d ): stub\n", __func__, name, flag );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int dlclose(void *handle)
|
||||
int dlclose( void *handle )
|
||||
{
|
||||
Con_DPrintf( "%s( %p ): stub\n", __func__, handle );
|
||||
return 0;
|
||||
@@ -95,14 +81,6 @@ void *COM_LoadLibrary( const char *dllname, int build_ordinals_table, qboolean d
|
||||
hInst = FS_FindLibrary( dllname, directpath );
|
||||
if( !hInst )
|
||||
{
|
||||
// HACKHACK: direct load dll
|
||||
#ifdef XASH_DLL_LOADER
|
||||
if( host.enabledll && ( pHandle = Loader_LoadLibrary(dllname)) )
|
||||
{
|
||||
return pHandle;
|
||||
}
|
||||
#endif
|
||||
|
||||
// try to find by linker(LD_LIBRARY_PATH, DYLD_LIBRARY_PATH, LD_32_LIBRARY_PATH and so on...)
|
||||
if( !pHandle )
|
||||
{
|
||||
@@ -125,34 +103,11 @@ void *COM_LoadLibrary( const char *dllname, int build_ordinals_table, qboolean d
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef XASH_DLL_LOADER
|
||||
if( host.enabledll && ( !Q_stricmp( COM_FileExtension( hInst->shortPath ), "dll" ) ) )
|
||||
if( !( hInst->hInstance = dlopen( hInst->fullPath, RTLD_NOW ) ) )
|
||||
{
|
||||
if( hInst->encrypted )
|
||||
{
|
||||
Q_snprintf( buf, sizeof( buf ), "Library %s is encrypted. Cannot load", hInst->shortPath );
|
||||
COM_PushLibraryError( buf );
|
||||
Mem_Free( hInst );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if( !( hInst->hInstance = Loader_LoadLibrary( hInst->fullPath ) ) )
|
||||
{
|
||||
Q_snprintf( buf, sizeof( buf ), "Failed to load DLL with DLL loader: %s", hInst->shortPath );
|
||||
COM_PushLibraryError( buf );
|
||||
Mem_Free( hInst );
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
if( !( hInst->hInstance = dlopen( hInst->fullPath, RTLD_NOW ) ) )
|
||||
{
|
||||
COM_PushLibraryError( dlerror() );
|
||||
Mem_Free( hInst );
|
||||
return NULL;
|
||||
}
|
||||
COM_PushLibraryError( dlerror() );
|
||||
Mem_Free( hInst );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pHandle = hInst->hInstance;
|
||||
@@ -164,29 +119,15 @@ void *COM_LoadLibrary( const char *dllname, int build_ordinals_table, qboolean d
|
||||
|
||||
void COM_FreeLibrary( void *hInstance )
|
||||
{
|
||||
#ifdef XASH_DLL_LOADER
|
||||
void *wm;
|
||||
if( host.enabledll && (wm = Loader_GetDllHandle( hInstance )) )
|
||||
return Loader_FreeLibrary( hInstance );
|
||||
else
|
||||
#endif
|
||||
{
|
||||
#ifdef Platform_POSIX_FreeLibrary
|
||||
Platform_POSIX_FreeLibrary( hInstance );
|
||||
Platform_POSIX_FreeLibrary( hInstance );
|
||||
#else
|
||||
dlclose( hInstance );
|
||||
dlclose( hInstance );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void *COM_GetProcAddress( void *hInstance, const char *name )
|
||||
{
|
||||
#ifdef XASH_DLL_LOADER
|
||||
void *wm;
|
||||
if( host.enabledll && (wm = Loader_GetDllHandle( hInstance )) )
|
||||
return Loader_GetProcAddress(hInstance, name);
|
||||
else
|
||||
#endif
|
||||
#if Platform_POSIX_GetProcAddress
|
||||
return Platform_POSIX_GetProcAddress( hInstance, name );
|
||||
#else
|
||||
@@ -201,20 +142,12 @@ void *COM_FunctionFromName( void *hInstance, const char *pName )
|
||||
|
||||
const char *COM_NameForFunction( void *hInstance, void *function )
|
||||
{
|
||||
#ifdef XASH_DLL_LOADER
|
||||
void *wm;
|
||||
if( host.enabledll && (wm = Loader_GetDllHandle( hInstance )) )
|
||||
#error ConvertMangledName
|
||||
return Loader_GetFuncName_int(wm, function);
|
||||
else
|
||||
#endif
|
||||
// NOTE: dladdr() is a glibc extension
|
||||
{
|
||||
Dl_info info = {0};
|
||||
int ret = dladdr( (void*)function, &info );
|
||||
if( ret && info.dli_sname )
|
||||
return COM_GetPlatformNeutralName( info.dli_sname );
|
||||
}
|
||||
Dl_info info = {0};
|
||||
int ret = dladdr( (void*)function, &info );
|
||||
if( ret && info.dli_sname )
|
||||
return COM_GetPlatformNeutralName( info.dli_sname );
|
||||
|
||||
#ifdef XASH_ALLOW_SAVERESTORE_OFFSETS
|
||||
return COM_OffsetNameForFunction( function );
|
||||
#else
|
||||
|
||||
@@ -149,9 +149,6 @@ def configure(conf):
|
||||
if not conf.env.DEST_OS in ['win32', 'android'] and have_async_resolve:
|
||||
conf.check_pthreads(mode='c')
|
||||
|
||||
if hasattr(conf.options, 'DLLEMU'):
|
||||
conf.define_cond('XASH_DLL_LOADER', conf.options.DLLEMU)
|
||||
|
||||
conf.check_cc(fragment=EXECINFO_TEST, msg='Checking for glibc backtrace()', mandatory=False, define_name='HAVE_EXECINFO')
|
||||
|
||||
conf.define('ENGINE_DLL', 1)
|
||||
@@ -200,7 +197,7 @@ def build(bld):
|
||||
# public includes for renderers and utils use
|
||||
bld(name = 'engine_includes', export_includes = '. common common/imagelib', use = 'filesystem_includes')
|
||||
|
||||
libs = ['engine_includes', 'public', 'dllemu', 'werror', 'backtrace']
|
||||
libs = ['engine_includes', 'public', 'werror', 'backtrace']
|
||||
includes = ['server', 'client', 'client/vgui', 'common/soundlib', 'platform']
|
||||
|
||||
# basic build: dedicated only
|
||||
|
||||
Reference in New Issue
Block a user