From 9a9b3400d93da796f2c656272a5b744ebf52aae7 Mon Sep 17 00:00:00 2001 From: oetiker Date: Wed, 14 Feb 2007 18:46:16 +0000 Subject: [PATCH] updates to the windows build system by guenter knauff git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2/program@1004 a5681a0c-68f1-0310-ab6d-d61299d08faa --- src/get_ver.awk | 31 +++++++++++++++++++---- win32/rrd.dsp | 37 ++++++++++++++++++++++++++-- win32/rrd_config.h.msvc | 65 +++++++++++++++++++++++++++++++++++++++++++++++++ win32/rrdtool.dsp | 8 +++--- 4 files changed, 130 insertions(+), 11 deletions(-) create mode 100644 win32/rrd_config.h.msvc diff --git a/src/get_ver.awk b/src/get_ver.awk index 3f6d5e9..e8c4552 100644 --- a/src/get_ver.awk +++ b/src/get_ver.awk @@ -1,5 +1,12 @@ -# fetch rrdtool version number from input file and write them to STDOUT +# **************************************************************************** +# RRDtool 1.2.19 Copyright by Tobi Oetiker, 1997-2007 +# **************************************************************************** +# get_ver.awk AWK Script for non-configure builds +# **************************************************************************** +# $Id: get_ver.awk 1000 2007-14-02 05:51:34Z oetiker $ +# **************************************************************************** BEGIN { + # fetch rrdtool version number from input file and write them to STDOUT while ((getline < ARGV[1]) > 0) { if (match ($0, /^AC_INIT/)) { split($1, t, ","); @@ -10,10 +17,24 @@ BEGIN { } if (match ($0, /^NUMVERS=/)) { split($1, t, "="); - my_num_ver = t[2]; + my_ver_num = t[2]; } } - print "RRD_VERSION = " my_ver ""; - print "RRD_VERSION_STR = " my_ver_str ""; - print "RRD_NUMVERS = " my_num_ver ""; + # read from from input file, replace placeholders, and write to STDOUT + if (ARGV[2]) { + while ((getline < ARGV[2]) > 0) { + if (match ($0, /@@NUMVERS@@/)) { + gsub("@@NUMVERS@@", my_ver_num, $0); + } + if (match ($0, /@@PACKAGE_VERSION@@/)) { + gsub("@@PACKAGE_VERSION@@", "" my_ver_str "", $0); + } + print; + } + } else { + print "RRD_VERSION = " my_ver ""; + print "RRD_VERSION_STR = " my_ver_str ""; + print "RRD_NUMVERS = " my_ver_num ""; + } } + diff --git a/win32/rrd.dsp b/win32/rrd.dsp index 286bcc5..b833e55 100644 --- a/win32/rrd.dsp +++ b/win32/rrd.dsp @@ -41,7 +41,7 @@ RSC=rc.exe # PROP Intermediate_Dir "release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /I "../src" /I "../../zlib-1.2.3" /I "../../libpng-1.2.12" /I "../../libart_lgpl-2.3.17" /I "../../freetype-2.2.1/include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_CTYPE_DISABLE_MACROS" /FD /c +# ADD CPP /nologo /MD /W3 /GX /I "../src" /I "../../zlib-1.2.3" /I "../../libpng-1.2.16" /I "../../libart_lgpl-2.3.17" /I "../../freetype-2.3.1/include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_CTYPE_DISABLE_MACROS" /FD /c # SUBTRACT CPP /X /YX # ADD BASE RSC /l 0x100c # ADD RSC /l 0x409 @@ -65,7 +65,7 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /Gm /GX /ZI /Od /I "../src" /I "../../zlib-1.2.3" /I "../../libpng-1.2.12" /I "../../libart_lgpl-2.3.17" /I "../../freetype-2.2.1/include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_CTYPE_DISABLE_MACROS" /FR /FD /c +# ADD CPP /nologo /MD /W3 /Gm /GX /ZI /Od /I "../src" /I "../../zlib-1.2.3" /I "../../libpng-1.2.16" /I "../../libart_lgpl-2.3.17" /I "../../freetype-2.3.1/include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_CTYPE_DISABLE_MACROS" /FR /FD /c # SUBTRACT CPP /X /YX # ADD BASE RSC /l 0x100c # ADD RSC /l 0x409 @@ -84,6 +84,35 @@ LIB32=link.exe -lib # Name "rrd - Win32 Debug" # Begin Source File +SOURCE="..\src\get_ver.awk" + +!IF "$(CFG)" == "rrd - Win32 Release" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating ..\rrd_config.h +InputPath="..\src\get_ver.awk" + +"..\rrd_config.h" : $(SOURCE) "..\configure.ac" "..\win32\rrd_config.h.msvc" + awk -f ..\src\get_ver.awk ..\configure.ac ..\win32\rrd_config.h.msvc > ..\rrd_config.h + +# End Custom Build + +!ELSEIF "$(CFG)" == "rrd - Win32 Debug" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating ..\rrd_config.h +InputPath="..\src\get_ver.awk" + +"..\rrd_config.h" : $(SOURCE) "..\configure.ac" "..\win32\rrd_config.h.msvc" + awk -f ..\src\get_ver.awk ..\configure.ac ..\win32\rrd_config.h.msvc > ..\rrd_config.h + +# End Custom Build + +!ENDIF + +# End Source File +# Begin Source File + SOURCE=..\src\rrd_afm.c # End Source File # Begin Source File @@ -144,6 +173,10 @@ SOURCE=..\src\rrd_last.c # End Source File # Begin Source File +SOURCE=..\src\rrd_lastupdate.c +# End Source File +# Begin Source File + SOURCE=..\src\rrd_nan_inf.c # End Source File # Begin Source File diff --git a/win32/rrd_config.h.msvc b/win32/rrd_config.h.msvc new file mode 100644 index 0000000..8a83923 --- /dev/null +++ b/win32/rrd_config.h.msvc @@ -0,0 +1,65 @@ +/* rrd_config.h.msvc. Hand-tweaked rrd_config.h for MSVC compiler. */ +#ifndef WIN32 +#error This rrd_config.h is created for Win32 platform! +#endif +#ifndef RRD_CONFIG_H +#define RRD_CONFIG_H + +#include +#include +#include + +/* the placeholders will be filled in by get_ver.awk */ +/* http://cm.bell-labs.com/cm/cs/awkbook/index.html */ +#define NUMVERS @@NUMVERS@@ +#define PACKAGE_VERSION "@@PACKAGE_VERSION@@" + +#define PACKAGE_NAME "rrdtool" +#define PACKAGE_STRING PACKAGE_NAME " " PACKAGE_VERSION + +#define HAVE_STRFTIME 1 +#define HAVE_TIME_H 1 +#define HAVE_LOCALE_H 1 +#define HAVE_TZSET 1 +#define HAVE_SETLOCALE 1 +#define HAVE_MATH_H 1 +#define HAVE_FLOAT_H 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MALLOC_H 1 +#define HAVE_MKTIME 1 +#define HAVE_STRFTIME 1 +#define HAVE_STRING_H 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +#define isinf(a) (_fpclass(a) == _FPCLASS_NINF || _fpclass(a) == _FPCLASS_PINF) +#define isnan _isnan +#define finite _finite +#define snprintf _snprintf +#define vsnprintf _vsnprintf +#define strftime strftime_ + +/* realloc does not support NULL as argument */ +#define NO_NULL_REALLOC 1 +#if NO_NULL_REALLOC +# define rrd_realloc(a,b) ( (a) == NULL ? malloc( (b) ) : realloc( (a) , (b) )) +#else +# define rrd_realloc(a,b) realloc((a), (b)) +#endif + +/* Vertical label angle: 90.0 (default) or 270.0 */ +#define RRDGRAPH_YLEGEND_ANGLE 90.0 + +#define RRD_DEFAULT_FONT "arial.ttf" +/* #define RRD_DEFAULT_FONT "DejaVuSansMono-Roman.ttf" */ + +/* #define WITH_PIECHART 1 */ + +/* #define DEBUG 1 */ + +#endif /* RRD_CONFIG_H */ + diff --git a/win32/rrdtool.dsp b/win32/rrdtool.dsp index 7b42213..006a0ca 100644 --- a/win32/rrdtool.dsp +++ b/win32/rrdtool.dsp @@ -42,7 +42,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /I "../src" /I "../../zlib-1.2.3" /I "../../libpng-1.2.12" /I "../../libart_lgpl-2.3.17" /I "../../freetype-2.2.1/include" /D "NDEBUG" /D "_WINDOWS" /D "WIN32" /D "_MBCS" /D "_CTYPE_DISABLE_MACROS" /FD /c +# ADD CPP /nologo /MD /W3 /GX /I "../src" /I "../../zlib-1.2.3" /I "../../libpng-1.2.16" /I "../../libart_lgpl-2.3.17" /I "../../freetype-2.3.1/include" /D "NDEBUG" /D "_WINDOWS" /D "WIN32" /D "_MBCS" /D "_CTYPE_DISABLE_MACROS" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x100c /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" @@ -51,7 +51,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 libpng.lib zlib.lib libart.lib freetype221MT.lib kernel32.lib user32.lib /nologo /subsystem:console /incremental:yes /debug /machine:I386 /libpath:"../../libpng-1.2.12/projects/visualc6/Win32_LIB_Release" /libpath:"../../zlib-1.2.3" /libpath:"../../libart_lgpl-2.3.17/win32/release" /libpath:"../../freetype-2.2.1/objs" +# ADD LINK32 libpng.lib zlib.lib libart.lib freetype231MT.lib kernel32.lib user32.lib /nologo /subsystem:console /incremental:yes /debug /machine:I386 /libpath:"../../libpng-1.2.16/projects/visualc6/Win32_LIB_Release" /libpath:"../../zlib-1.2.3" /libpath:"../../libart_lgpl-2.3.17/win32/release" /libpath:"../../freetype-2.3.1/objs" !ELSEIF "$(CFG)" == "rrdtool - Win32 Debug" @@ -67,7 +67,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /Gm /GX /ZI /Od /I "../src" /I "../../zlib-1.2.3" /I "../../libpng-1.2.12" /I "../../libart_lgpl-2.3.17" /I "../../freetype-2.2.1/include" /D "_DEBUG" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /D "_CTYPE_DISABLE_MACROS" /FR /FD /c +# ADD CPP /nologo /MD /W3 /Gm /GX /ZI /Od /I "../src" /I "../../zlib-1.2.3" /I "../../libpng-1.2.16" /I "../../libart_lgpl-2.3.17" /I "../../freetype-2.3.1/include" /D "_DEBUG" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /D "_CTYPE_DISABLE_MACROS" /FR /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x100c /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" @@ -76,7 +76,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo /o"rrdtool.bsc" LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 libpng.lib zlib.lib libart.lib freetype221MT.lib kernel32.lib user32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"../../libpng-1.2.12/projects/visualc6/Win32_LIB_Release" /libpath:"../../zlib-1.2.3" /libpath:"../../libart_lgpl-2.3.17/win32/release" /libpath:"../../freetype-2.2.1/objs" +# ADD LINK32 libpng.lib zlib.lib libart.lib freetype231MT.lib kernel32.lib user32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"../../libpng-1.2.16/projects/visualc6/Win32_LIB_Release" /libpath:"../../zlib-1.2.3" /libpath:"../../libart_lgpl-2.3.17/win32/release" /libpath:"../../freetype-2.3.1/objs" !ENDIF -- 2.11.0