From 22c4efcd79ff653e761ea9e42699a3e86400dc74 Mon Sep 17 00:00:00 2001 From: res Date: Wed, 16 Jan 2008 11:19:30 +0000 Subject: [PATCH] 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 --- cl_gecko.c | 12 +++++++++++- makefile.inc | 6 ++++++ 2 files changed, 17 insertions(+), 1 deletion(-) 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= -- 2.39.2