From 2cf2afc458afe8a7055c5a3c6f07b24cd629f551 Mon Sep 17 00:00:00 2001 From: Stefan Gehn Date: Wed, 29 Oct 2008 16:02:13 +0000 Subject: [PATCH] - comment out all options in default gkrellmd.conf so it can be installed without causing any trouble - move gkrellm[d] version into its own header - win32: determine version from headers instead of hardcoding them in the .rc files --- server/Makefile | 6 ++--- server/gkrellmd-version.h | 35 +++++++++++++++++++++++++++++ server/gkrellmd.conf | 10 +++++---- server/gkrellmd.h | 14 +----------- server/win32-resource.rc | 13 +++++++---- src/Makefile | 6 ++--- src/gkrellm-version.h | 47 +++++++++++++++++++++++++++++++++++++++ src/gkrellm.h | 16 +------------ src/win32-resource.rc | 13 +++++++---- 9 files changed, 114 insertions(+), 46 deletions(-) create mode 100644 server/gkrellmd-version.h create mode 100644 src/gkrellm-version.h diff --git a/server/Makefile b/server/Makefile index caf2bca..92fa1e5 100644 --- a/server/Makefile +++ b/server/Makefile @@ -51,7 +51,7 @@ endif CC ?= gcc STRIP ?= -s -GKRELLMD_INCLUDES = gkrellmd.h $(SHARED_PATH)/log.h +GKRELLMD_INCLUDES = gkrellmd.h gkrellmd-version.h $(SHARED_PATH)/log.h PKG_INCLUDE = `$(PKG_CONFIG) --cflags glib-2.0 gthread-2.0` PKG_LIB = `$(PKG_CONFIG) --libs glib-2.0 gmodule-2.0 gthread-2.0` @@ -234,7 +234,7 @@ SYSDEPS = ../src/sysdeps/bsd-common.c ../src/sysdeps/bsd-net-open.c \ ../src/sysdeps/openbsd.c ../src/sysdeps/sensors-common.c \ ../src/sysdeps/solaris.c ../src/sysdeps/win32.c -GKRELLMD_H = gkrellmd.h gkrellmd-private.h +GKRELLMD_H = gkrellmd.h gkrellmd-version.h gkrellmd-private.h main.o: main.c $(GKRELLMD_H) monitor.o: monitor.c $(GKRELLMD_H) @@ -247,7 +247,7 @@ log.o: $(SHARED_PATH)/log.c $(SHARED_PATH)/log.h $(GKRELLMD_H) win32-gui.o: win32-gui.c win32-plugin.o: win32-plugin.c win32-plugin.h $(GKRELLMD_H) win32-resource.o: win32-resource.rc win32-resource.h - windres -I.. -o win32-resource.o win32-resource.rc + windres -v -I.. -o win32-resource.o win32-resource.rc win32-libgkrellmd.o: win32-libgkrellmd.c win32-plugin.h $(GKRELLMD_H) libgkrellmd.a: win32-libgkrellmd.o ar -cr libgkrellmd.a win32-libgkrellmd.o diff --git a/server/gkrellmd-version.h b/server/gkrellmd-version.h new file mode 100644 index 0000000..3ccd6e3 --- /dev/null +++ b/server/gkrellmd-version.h @@ -0,0 +1,35 @@ +/* GKrellM +| Copyright (C) 1999-2007 Bill Wilson +| +| Author: Bill Wilson billw@gkrellm.net +| Latest versions might be found at: http://gkrellm.net +| +| +| GKrellM 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 3 of the License, or +| (at your option) any later version. +| +| GKrellM 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, see http://www.gnu.org/licenses/ +*/ +#ifndef GKRELLMD_VERSION_H +#define GKRELLMD_VERSION_H + +#define GKRELLMD_VERSION_MAJOR 2 +#define GKRELLMD_VERSION_MINOR 3 +#define GKRELLMD_VERSION_REV 2 +#define GKRELLMD_EXTRAVERSION "-rc1" + +#define GKRELLMD_CHECK_VERSION(major,minor,rev) \ +(GKRELLMD_VERSION_MAJOR > (major) || \ +(GKRELLMD_VERSION_MAJOR == (major) && GKRELLMD_VERSION_MINOR > (minor)) || \ +(GKRELLMD_VERSION_MAJOR == (major) && GKRELLMD_VERSION_MINOR == (minor) && \ +GKRELLMD_VERSION_REV >= (rev))) + +#endif // GKRELLMD_VERSION_H diff --git a/server/gkrellmd.conf b/server/gkrellmd.conf index 477a4ba..34240a0 100644 --- a/server/gkrellmd.conf +++ b/server/gkrellmd.conf @@ -4,20 +4,20 @@ # the client update frequency. Values may be from 1 to 10 and should be # smaller values to reduce network traffic. # -update-hz 3 +#update-hz 3 # Limit number of simultaneous clients allowed to connect. # -max-clients 2 +#max-clients 2 # Specify a specific network interface to listen on for connections. # By default gkrellmd listens on all available network interfaces. # -address 127.0.0.1 +#address 127.0.0.1 # Specify the port to listen on for connections. # -port 19150 +#port 19150 # List of hosts allowed to connect. If no hosts are specified in a # gkrellmd.conf file or on the command line, all hosts will be allowed. @@ -44,6 +44,8 @@ port 19150 #detach # Enable writing logging message to the system syslog file +# NOTE: On windows this enables logging to the windows event log +# #syslog # Time interval between checks for various monitors. If nfs-interval diff --git a/server/gkrellmd.h b/server/gkrellmd.h index d702ce0..c953318 100644 --- a/server/gkrellmd.h +++ b/server/gkrellmd.h @@ -22,6 +22,7 @@ #define GKRELLMD_H #include "log.h" +#include "gkrellmd-version.h" #include #include @@ -92,19 +93,6 @@ # define bindtextdomain(Domain,Directory) (Domain) #endif /* ENABLE_NLS */ -/* ------------------------------------------------------------------- -*/ -#define GKRELLMD_VERSION_MAJOR 2 -#define GKRELLMD_VERSION_MINOR 3 -#define GKRELLMD_VERSION_REV 2 -#define GKRELLMD_EXTRAVERSION "" - -#define GKRELLMD_CHECK_VERSION(major,minor,rev) \ -(GKRELLMD_VERSION_MAJOR > (major) || \ -(GKRELLMD_VERSION_MAJOR == (major) && GKRELLMD_VERSION_MINOR > (minor)) || \ -(GKRELLMD_VERSION_MAJOR == (major) && GKRELLMD_VERSION_MINOR == (minor) && \ -GKRELLMD_VERSION_REV >= (rev))) - #define GKRELLMD_CONFIG "gkrellmd.conf" #if defined(WIN32) // no dot in front of config-filename on win32 diff --git a/server/win32-resource.rc b/server/win32-resource.rc index 1c54bcb..5906445 100644 --- a/server/win32-resource.rc +++ b/server/win32-resource.rc @@ -3,15 +3,20 @@ // http://www.resedit.net #include "win32-resource.h" -#include "windows.h" +#include "gkrellmd-version.h" +#include +// you don't really want to know why this looks so ugly :P +#define STRINGIFY(x) #x +#define TOSTRING(x) STRINGIFY(x) +#define RC_VER_STRING TOSTRING(GKRELLMD_VERSION_MAJOR) "." TOSTRING(GKRELLMD_VERSION_MINOR) "." TOSTRING(GKRELLMD_VERSION_REV) GKRELLMD_EXTRAVERSION // // Version Information resources // LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL 1 VERSIONINFO - FILEVERSION 2,3,2,0 + FILEVERSION GKRELLMD_VERSION_MAJOR,GKRELLMD_VERSION_MINOR,GKRELLMD_VERSION_REV,0 PRODUCTVERSION 0,0,0,0 FILEOS VOS_NT_WINDOWS32 FILETYPE VFT_APP @@ -22,12 +27,12 @@ BEGIN BEGIN VALUE "CompanyName", "" VALUE "FileDescription", "GKrellM Daemon" - VALUE "FileVersion", "2.3.2" + VALUE "FileVersion", RC_VER_STRING VALUE "InternalName", "gkrellmd" VALUE "LegalCopyright", "Copyright (C) 1999-2008 Bill Wilson" VALUE "OriginalFilename", "gkrellmd.exe" VALUE "ProductName", "GKrellM" - VALUE "ProductVersion", "2.3.2" + VALUE "ProductVersion", RC_VER_STRING END END BLOCK "VarFileInfo" diff --git a/src/Makefile b/src/Makefile index 8db4059..1fb1e8f 100644 --- a/src/Makefile +++ b/src/Makefile @@ -74,7 +74,7 @@ endif CC ?= gcc STRIP ?= -s -GKRELLM_INCLUDES = gkrellm.h gkrellm-public-proto.h $(SHARED_PATH)/log.h +GKRELLM_INCLUDES = gkrellm.h gkrellm-version.h gkrellm-public-proto.h $(SHARED_PATH)/log.h PKG_INCLUDE = `$(PKG_CONFIG) --cflags gtk+-2.0 gthread-2.0` PKG_LIB = `$(PKG_CONFIG) --libs gtk+-2.0 gthread-2.0` @@ -311,7 +311,7 @@ SYSDEPS_SRC = sysdeps/bsd-common.c sysdeps/bsd-net-open.c sysdeps/freebsd.c \ sysdeps/solaris.c sysdeps/darwin.c sysdeps/sensors-common.c \ sysdeps/win32.c -GKRELLM_H = gkrellm.h gkrellm-private.h +GKRELLM_H = gkrellm.h gkrellm-version.h gkrellm-private.h GKRELLM_H_SYS = gkrellm.h gkrellm-public-proto.h gkrellm-private.h \ gkrellm-sysdeps.h @@ -352,7 +352,7 @@ winops-win32.o: winops-win32.c $(GKRELLM_H) win32-plugin.o: win32-plugin.c win32-plugin.h win32-libgkrellm.o: win32-libgkrellm.c win32-plugin.h win32-resource.o: win32-resource.rc win32-resource.h - windres -o win32-resource.o win32-resource.rc + windres -v -o win32-resource.o win32-resource.rc libgkrellm.a: win32-libgkrellm.o ar -cr libgkrellm.a win32-libgkrellm.o diff --git a/src/gkrellm-version.h b/src/gkrellm-version.h new file mode 100644 index 0000000..fbb7542 --- /dev/null +++ b/src/gkrellm-version.h @@ -0,0 +1,47 @@ +/* GKrellM +| Copyright (C) 1999-2008 Bill Wilson +| +| Author: Bill Wilson billw@gkrellm.net +| Latest versions might be found at: http://gkrellm.net +| +| +| GKrellM 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 3 of the License, or +| (at your option) any later version. +| +| GKrellM 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, see http://www.gnu.org/licenses/ +| +| +| Additional permission under GNU GPL version 3 section 7 +| +| If you modify this program, or any covered work, by linking or +| combining it with the OpenSSL project's OpenSSL library (or a +| modified version of that library), containing parts covered by +| the terms of the OpenSSL or SSLeay licenses, you are granted +| additional permission to convey the resulting work. +| Corresponding Source for a non-source form of such a combination +| shall include the source code for the parts of OpenSSL used as well +| as that of the covered work. +*/ +#ifndef GKRELLM_VERSION_H +#define GKRELLM_VERSION_H + +#define GKRELLM_VERSION_MAJOR 2 +#define GKRELLM_VERSION_MINOR 3 +#define GKRELLM_VERSION_REV 2 +#define GKRELLM_EXTRAVERSION "-rc1" + +#define GKRELLM_CHECK_VERSION(major,minor,rev) \ + (GKRELLM_VERSION_MAJOR > (major) || \ + (GKRELLM_VERSION_MAJOR == (major) && GKRELLM_VERSION_MINOR > (minor)) || \ + (GKRELLM_VERSION_MAJOR == (major) && GKRELLM_VERSION_MINOR == (minor) && \ + GKRELLM_VERSION_REV >= (rev))) + +#endif // GKRELLM_VERSION_H diff --git a/src/gkrellm.h b/src/gkrellm.h index 722086c..4059585 100644 --- a/src/gkrellm.h +++ b/src/gkrellm.h @@ -39,6 +39,7 @@ #include "config.h" #endif #include "log.h" +#include "gkrellm-version.h" #if !defined(WIN32) #include @@ -102,21 +103,6 @@ #endif /* ENABLE_NLS */ - - -/* ------------------------------------------------------------------- -*/ -#define GKRELLM_VERSION_MAJOR 2 -#define GKRELLM_VERSION_MINOR 3 -#define GKRELLM_VERSION_REV 2 -#define GKRELLM_EXTRAVERSION "" - -#define GKRELLM_CHECK_VERSION(major,minor,rev) \ - (GKRELLM_VERSION_MAJOR > (major) || \ - (GKRELLM_VERSION_MAJOR == (major) && GKRELLM_VERSION_MINOR > (minor)) || \ - (GKRELLM_VERSION_MAJOR == (major) && GKRELLM_VERSION_MINOR == (minor) && \ - GKRELLM_VERSION_REV >= (rev))) - #define GKRELLM_DIR ".gkrellm2" #define GKRELLM_USER_CONFIG ".gkrellm2/user-config" #define GKRELLM_2_1_14_CONFIG ".gkrellm2/user_config" diff --git a/src/win32-resource.rc b/src/win32-resource.rc index b1f9edc..d6254d9 100644 --- a/src/win32-resource.rc +++ b/src/win32-resource.rc @@ -3,8 +3,13 @@ // http://www.resedit.net #include "win32-resource.h" -#include "windows.h" +#include "gkrellm-version.h" +#include +// you don't really want to know why this looks so ugly :P +#define STRINGIFY(x) #x +#define TOSTRING(x) STRINGIFY(x) +#define RC_VER_STRING TOSTRING(GKRELLM_VERSION_MAJOR) "." TOSTRING(GKRELLM_VERSION_MINOR) "." TOSTRING(GKRELLM_VERSION_REV) GKRELLM_EXTRAVERSION // // Icon resources @@ -18,7 +23,7 @@ IDI_ICON3 ICON "gkrellm.ico" // LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL 1 VERSIONINFO - FILEVERSION 2,3,2,0 + FILEVERSION GKRELLM_VERSION_MAJOR,GKRELLM_VERSION_MINOR,GKRELLM_VERSION_REV,0 PRODUCTVERSION 0,0,0,0 FILEOS VOS_NT_WINDOWS32 FILETYPE VFT_APP @@ -29,12 +34,12 @@ BEGIN BEGIN VALUE "CompanyName", "" VALUE "FileDescription", "GKrellM" - VALUE "FileVersion", "2.3.2" + VALUE "FileVersion", RC_VER_STRING VALUE "InternalName", "gkrellm" VALUE "LegalCopyright", "Copyright (C) 1999-2008 Bill Wilson" VALUE "OriginalFilename", "gkrellm.exe" VALUE "ProductName", "GKrellM" - VALUE "ProductVersion", "2.3.2" + VALUE "ProductVersion", RC_VER_STRING END END BLOCK "VarFileInfo"