]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Removed passing machine type from the makefile to the compiler; instead, determine...
authorres <res@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 18 Jan 2008 15:38:00 +0000 (15:38 +0000)
committerres <res@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 18 Jan 2008 15:38:00 +0000 (15:38 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7977 d7cf8633-e32d-0410-b094-e92efae38249

cl_gecko.c
host.c
makefile.inc
quakedef.h

index 133def8b9446b8f4bd5e721325f473a02190666e..9daec00907d73c85ee9fc604e1ca19b07983f6b3 100644 (file)
@@ -364,8 +364,8 @@ void CL_Gecko_GetTextureExtent( clgecko_t *instance, float* pwidth, float* pheig
 # 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
+#elif defined(DP_OS_STR) && defined(DP_ARCH_STR)
+# define XULRUNNER_DIR_SUFFIX  DP_OS_STR "-" DP_ARCH_STR
 #endif
 
 clgecko_t * CL_Gecko_CreateBrowser( const char *name ) {
@@ -639,7 +639,7 @@ void CL_Gecko_Init( void )
        #elif defined(MACOSX)
                "OffscreenGecko.dylib",
        #else
-               "OffscreenGecko.so",
+               "libOffscreenGecko.so",
        #endif
                NULL
        };
diff --git a/host.c b/host.c
index 62192c141a30de3868e29ca405fa15c75af1fe94..f395b478f8b454df1f27f197777d42732dc62a6a 100644 (file)
--- a/host.c
+++ b/host.c
@@ -992,23 +992,7 @@ static void Host_Init (void)
        COM_InitGameType();
 
        // construct a version string for the corner of the console
-#if defined(__linux__)
-       os = "Linux";
-#elif defined(WIN32)
-       os = "Windows";
-#elif defined(__FreeBSD__)
-       os = "FreeBSD";
-#elif defined(__NetBSD__)
-       os = "NetBSD";
-#elif defined(__OpenBSD__)
-       os = "OpenBSD";
-#elif defined(MACOSX)
-       os = "Mac OS X";
-#elif defined(__MORPHOS__)
-       os = "MorphOS";
-#else
-       os = "Unknown";
-#endif
+       os = DP_OS_NAME;
        dpsnprintf (engineversion, sizeof (engineversion), "%s %s %s", gamename, os, buildstring);
        Con_Printf("%s\n", engineversion);
 
index a289d6b9fe51c05db28bf7d40de06b28cde017bc..9a9c51bbde48ce4f40ff31f2431df2ddde5fb604 100644 (file)
@@ -152,12 +152,6 @@ 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=
index 36221f3ad2a090fa20062bb3024c31c978d7ad4b..bb9bb8406dec5de8e57c58ff106c4ab46f923fe8 100644 (file)
@@ -259,9 +259,55 @@ extern char engineversion[128];
 
 extern qboolean noclip_anglehack;
 
-extern char engineversion[128];
 extern cvar_t developer;
 
+/* Preprocessor macros to identify platform
+    DP_OS_NAME         - "friendly" name of the OS, for humans to read
+    DP_OS_STR  - "identifier" of the OS, more suited for code to use
+    DP_ARCH_STR        - "identifier" of the processor architecture
+ */
+#if defined(__linux__)
+# define DP_OS_NAME            "Linux"
+# define DP_OS_STR             "linux"
+#elif defined(WIN64)
+# define DP_OS_NAME            "Windows64"
+# define DP_OS_STR             "win64"
+#elif defined(WIN32)
+# define DP_OS_NAME            "Windows"
+# define DP_OS_STR             "win32"
+#elif defined(__FreeBSD__)
+# define DP_OS_NAME            "FreeBSD"
+# define DP_OS_STR             "freebsd"
+#elif defined(__NetBSD__)
+# define DP_OS_NAME            "NetBSD"
+# define DP_OS_STR             "netbsd"
+#elif defined(__OpenBSD__)
+# define DP_OS_NAME            "OpenBSD"
+# define DP_OS_STR             "openbsd"
+#elif defined(MACOSX)
+# define DP_OS_NAME            "Mac OS X"
+# define DP_OS_STR             "osx"
+#elif defined(__MORPHOS__)
+# define DP_OS_NAME            "MorphOS"
+# define DP_OS_STR             "morphos"
+#else
+# define DP_OS_NAME            "Unknown"
+#endif
+
+#if defined(__GNUC__)
+# if defined(__i386__)
+#  define DP_ARCH_STR          "686"
+# elif defined(__x86_64__)
+#  define DP_ARCH_STR          "x86_64"
+# elif defined(__powerpc__)
+#  define DP_ARCH_STR          "ppc"
+# endif
+#elif defined(WIN64)
+# define DP_ARCH_STR           "x86_64"
+#elif defined(WIN32)
+# define DP_ARCH_STR           "x86"
+#endif
+
 // incremented every frame, never reset
 extern int host_framecount;
 // not bounded in any way, changed at start of every frame, never reset