From 1c775689ab1d1d3609353452549559795bdbbe6c Mon Sep 17 00:00:00 2001 From: Jamie Wilkinson Date: Fri, 5 Apr 2002 01:02:17 +0000 Subject: [PATCH] * Got rid of that ugly -DLINUX_VERSION from the makefile, instead source files now use config.h --- configure.in | 2 +- src/Makefile.am | 2 +- src/common.c | 6 +++++- src/console.c | 7 ++++++- src/main.c | 6 +++++- src/qcommon.h | 3 ++- src/sv_main.c | 43 ++++++++++++++++++++++++------------------- 7 files changed, 44 insertions(+), 25 deletions(-) diff --git a/configure.in b/configure.in index c1c6ad7..3fe4fbf 100644 --- a/configure.in +++ b/configure.in @@ -12,7 +12,7 @@ dnl echo restart configure dnl exit 1 dnl ) -AM_INIT_AUTOMAKE(quake2, 0.1, quake2-devel@quakeforge.net) +AM_INIT_AUTOMAKE(quake2, 0.1) AM_MAINTAINER_MODE diff --git a/src/Makefile.am b/src/Makefile.am index 97d8145..09d1ee4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -48,7 +48,7 @@ ref_glx_so_SOURCES = $(REF_GL) gl_glx.c #ref_sdlgl_so_SOURCES = $(REF_GL) rw_sdl.c AM_CFLAGS = -Wall -Werror -pipe -AM_CPPFLAGS = -DLINUX_VERSION="\"$(VERSION)\"" -Dstricmp=strcasecmp -I../game +AM_CPPFLAGS = -Dstricmp=strcasecmp -I../game ref_glx_so_CFLAGS = -fPIC ref_glx_so_LDFLAGS = -shared diff --git a/src/common.c b/src/common.c index 18313bc..ec08874 100644 --- a/src/common.c +++ b/src/common.c @@ -21,6 +21,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "qcommon.h" #include @@ -1485,7 +1489,7 @@ void Qcommon_Init (int argc, char **argv) /* lose the arch s = va("%4.2f %s %s %s", VERSION, CPUSTRING, __DATE__, BUILDSTRING); */ - s = va("%4.2f %s %s", VERSION, __DATE__, BUILDSTRING); + s = va("%s %s %s", VERSION, __DATE__, BUILDSTRING); Cvar_Get ("version", s, CVAR_SERVERINFO|CVAR_NOSET); diff --git a/src/console.c b/src/console.c index 99e2e86..477b881 100644 --- a/src/console.c +++ b/src/console.c @@ -19,8 +19,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // console.c +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "client.h" + console_t con; cvar_t *con_notifytime; @@ -588,7 +593,7 @@ void Con_DrawConsole (float frac) SCR_AddDirtyPoint (0,0); SCR_AddDirtyPoint (viddef.width-1,lines-1); - Com_sprintf (version, sizeof(version), "v%4.2f", VERSION); + Com_sprintf (version, sizeof(version), "v%s", VERSION); for (x=0 ; x<5 ; x++) re.DrawChar (viddef.width-44+x*8, lines-12, 128 + version[x] ); diff --git a/src/main.c b/src/main.c index 8ec0085..678117c 100644 --- a/src/main.c +++ b/src/main.c @@ -61,6 +61,10 @@ #define dlsym(X, Y) dlsym(X, "_"##Y) #endif +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "qcommon.h" #include "game.h" #include "rw.h" @@ -325,7 +329,7 @@ int main (int argc, char **argv) seteuid(getuid()); /* relnev 0.9 added -- jaq */ - printf("Quake II -- Version %s\n", LINUX_VERSION); + printf("QuakeIIForge %s\n", VERSION); Qcommon_Init(argc, argv); diff --git a/src/qcommon.h b/src/qcommon.h index bd815a7..63db9f1 100644 --- a/src/qcommon.h +++ b/src/qcommon.h @@ -24,7 +24,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "q_shared.h" -#define VERSION 3.21 +/* we define this in config.h now */ +/* #define VERSION 3.21 */ #define BASEDIRNAME "baseq2" diff --git a/src/sv_main.c b/src/sv_main.c index 1dd3e6f..187b36e 100644 --- a/src/sv_main.c +++ b/src/sv_main.c @@ -1,22 +1,27 @@ -/* -Copyright (C) 1997-2001 Id Software, Inc. +/* $Id$ + * + * Copyright (C) 1997-2001 Id Software, Inc. + * Copyright (c) 2002 The Quakeforge Project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -*/ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include "server.h" @@ -284,7 +289,7 @@ void SVC_DirectConnect (void) version = atoi(Cmd_Argv(1)); if (version != PROTOCOL_VERSION) { - Netchan_OutOfBandPrint (NS_SERVER, adr, "print\nServer is version %4.2f.\n", VERSION); + Netchan_OutOfBandPrint (NS_SERVER, adr, "print\nServer is version %s.\n", VERSION); Com_DPrintf (" rejected connect from version %i\n", version); return; }