From: res Date: Wed, 16 Jan 2008 11:19:30 +0000 (+0000) Subject: Gecko: add a platform-specific search path for XULrunner. This makes it possible... X-Git-Tag: xonotic-v0.1.0preview~2541 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=22c4efcd79ff653e761ea9e42699a3e86400dc74;p=xonotic%2Fdarkplaces.git Gecko: add a platform-specific search path for XULrunner. This makes it possible to keep versions for different platforms side-by-side. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7967 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_gecko.c b/cl_gecko.c index bff858c9..db80596d 100644 --- a/cl_gecko.c +++ b/cl_gecko.c @@ -360,6 +360,13 @@ void CL_Gecko_GetTextureExtent( clgecko_t *instance, float* pwidth, float* pheig *pheight = (float)instance->height / instance->texHeight; } +#if defined(WIN64) +# define XULRUNNER_DIR_SUFFIX "win64" +#elif defined(WIN32) +# define XULRUNNER_DIR_SUFFIX "win32" +#elif defined(DP_ARCH) && defined(DP_MACHINE) +# define XULRUNNER_DIR_SUFFIX DP_ARCH "-" DP_MACHINE +#endif clgecko_t * CL_Gecko_CreateBrowser( const char *name ) { clgecko_t *instance; @@ -379,7 +386,10 @@ clgecko_t * CL_Gecko_CreateBrowser( const char *name ) { Con_Printf( "CL_Gecko_CreateBrowser: setting up gecko embedding\n" ); } - options = osgk_embedding_options_create(); + options = osgk_embedding_options_create(); + #ifdef XULRUNNER_DIR_SUFFIX + osgk_embedding_options_add_search_path( options, "./xulrunner-" XULRUNNER_DIR_SUFFIX "/" ); + #endif osgk_embedding_options_add_search_path( options, "./xulrunner/" ); dpsnprintf (profile_path, sizeof (profile_path), "%s/xulrunner_profile/", fs_gamedir); osgk_embedding_options_set_profile_dir( options, profile_path, 0 ); diff --git a/makefile.inc b/makefile.inc index 9a9c51bb..608677fe 100644 --- a/makefile.inc +++ b/makefile.inc @@ -152,6 +152,12 @@ OBJ_SDL= builddate.c sys_sdl.o vid_sdl.o $(OBJ_SND_COMMON) snd_sdl.o cd_sdl.o $( # Compilation CFLAGS_COMMON=$(CFLAGS_MAKEDEP) $(CFLAGS_PRELOAD) $(CFLAGS_FS) -Wall -Wsign-compare -Wdeclaration-after-statement +ifdef DP_ARCH +CFLAGS_COMMON+=-DDP_ARCH=\\\"$(DP_ARCH)\\\" +endif +ifdef DP_MACHINE +CFLAGS_COMMON+=-DDP_MACHINE=\\\"$(DP_MACHINE)\\\" +endif CFLAGS_DEBUG=-ggdb CFLAGS_PROFILE=-g -pg -ggdb CFLAGS_RELEASE=