From: jake Date: Thu, 20 Jun 2002 00:21:03 +0000 (+0000) Subject: More Win32 build changes; thanks to Kerry Calvert. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=14772c029e97b783a39309173de23a7c4f6830d7;p=rrdtool-all.git More Win32 build changes; thanks to Kerry Calvert. git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@146 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/program/NT-BUILD-TIPS.txt b/program/NT-BUILD-TIPS.txt index 9c35d449..0545116f 100644 --- a/program/NT-BUILD-TIPS.txt +++ b/program/NT-BUILD-TIPS.txt @@ -18,7 +18,8 @@ configure script-- but of course not on Win32 platforms). ..\..\confignt (which contains a static Win32 version of config.h) should be on the include path. (4) Fonts are located in the %windir%\fonts, so the default font -is c:\winnt\fonts\cour.ttf. +is c:\winnt\fonts\cour.ttf. (6/19/02) At Kerry Calvert's suggestion +this setting was moved to confignt\config.h. (5) libart requires a custom build step to generate art_config.h; this is done manually via the commands: cl -I..\..\confignt gen_art_config.c diff --git a/program/bindings/perl-shared/RRDs.xs b/program/bindings/perl-shared/RRDs.xs index a0001f79..1340b6f8 100644 --- a/program/bindings/perl-shared/RRDs.xs +++ b/program/bindings/perl-shared/RRDs.xs @@ -17,6 +17,7 @@ extern "C" { #define PL_sv_undef sv_undef #endif + #define rrdcode(name) \ argv = (char **) malloc((items+1)*sizeof(char *));\ argv[0] = "dummy";\ @@ -149,16 +150,16 @@ rrd_graph(...) if (rrd_test_error()) { if(calcpr) for(i=0;calcpr[i];i++) - free(calcpr[i]); + rrd_freemem(calcpr[i]); XSRETURN_UNDEF; } retar=newAV(); if(calcpr){ for(i=0;calcpr[i];i++){ av_push(retar,newSVpv(calcpr[i],0)); - free(calcpr[i]); + rrd_freemem(calcpr[i]); } - free(calcpr); + rrd_freemem(calcpr); } EXTEND(sp,4); PUSHs(sv_2mortal(newRV_noinc((SV*)retar))); @@ -198,9 +199,9 @@ rrd_fetch(...) names=newAV(); for (ii = 0; ii < ds_cnt; ii++){ av_push(names,newSVpv(ds_namv[ii],0)); - free(ds_namv[ii]); + rrd_freemem(ds_namv[ii]); } - free(ds_namv); + rrd_freemem(ds_namv); /* convert the data array into perl format */ datai=data; retar=newAV(); @@ -212,7 +213,7 @@ rrd_fetch(...) } av_push(retar,newRV_noinc((SV*)line)); } - free(data); + rrd_freemem(data); EXTEND(sp,5); PUSHs(sv_2mortal(newSViv(start+step))); PUSHs(sv_2mortal(newSViv(step))); @@ -254,9 +255,9 @@ rrd_xport(...) names=newAV(); for (ii = 0; ii < col_cnt; ii++){ av_push(names,newSVpv(legend_v[ii],0)); - free(legend_v[ii]); + rrd_freemem(legend_v[ii]); } - free(legend_v); + rrd_freemem(legend_v); /* convert the data array into perl format */ ptr=data; @@ -269,7 +270,7 @@ rrd_xport(...) } av_push(retar,newRV_noinc((SV*)line)); } - free(data); + rrd_freemem(data); EXTEND(sp,7); PUSHs(sv_2mortal(newSViv(start+step))); @@ -325,15 +326,15 @@ rrd_info(...) break; case RD_I_STR: hvs(newSVpv(data->value.u_str,0)); - free(data->value.u_str); + rrd_freemem(data->value.u_str); break; } #undefine hvs - free(data->key); + rrd_freemem(data->key); data = data->next; - free(save); + rrd_freemem(save); } - free(data); + rrd_freemem(data); RETVAL = newRV_noinc((SV*)hash); OUTPUT: RETVAL diff --git a/program/bindings/perl-shared/ntmake.pl b/program/bindings/perl-shared/ntmake.pl index 7a4938cd..abaf9193 100644 --- a/program/bindings/perl-shared/ntmake.pl +++ b/program/bindings/perl-shared/ntmake.pl @@ -11,9 +11,10 @@ WriteMakefile( # 'DEFINE' => "-DPERLPATCHLEVEL=$Config{PATCHLEVEL}", 'DEFINE' => "-DPERLPATCHLEVEL=5", - 'INC' => '-I../../src/ -I../../libraries/freetype-2.0.5/include -I ../../libraries/libart_lgpl-2.3.7 -I ../../libraries/zlib-1.1.4 -I ../../libraries/libpng-1.2.0', + 'INC' => '-I../../src/ -I../../libraries/freetype-2.0.5/include -I ../../libraries/libart_lgpl-2.3.7 -I ../../libraries/zlib-1.1.4 -I ../../libraries/libpng-1.2.0', + 'OPTIMIZE' => '-O2 -MT', # change this path to refer to your libc.lib - 'MYEXTLIB' => 'e:/micros~1.net/vc7/lib/libcmt.lib ../../src/release/rrd.lib ../../libraries/libart_lgpl-2.3.7/release/libart.lib ../../libraries/zlib-1.1.4/release/zlib.lib ../../libraries/libpng-1.2.0\release\png.lib ../../libraries/freetype-2.0.5/release/freetype.lib', + 'MYEXTLIB' => 'c:/vc98/lib/libcmt.lib ../../src/release/rrd.lib ../../libraries/libart_lgpl-2.3.7/release/libart.lib ../../libraries/zlib-1.1.4/release/zlib.lib ../../libraries/libpng-1.2.0\release\png.lib ../../libraries/freetype-2.0.5/release/freetype.lib', 'realclean' => {FILES => 't/demo?.rrd t/demo?.png' }, ($] ge '5.005') ? ( 'AUTHOR' => 'Tobias Oetiker (oetiker@ee.ethz.ch)', diff --git a/program/confignt/config.h b/program/confignt/config.h index 4e4c37c7..f31bba14 100644 --- a/program/confignt/config.h +++ b/program/confignt/config.h @@ -14,3 +14,6 @@ #define rrd_realloc(a,b) realloc((a), (b)) #define snprintf _snprintf + +/* change this to %windir%/fonts */ +#define RRD_DEFAULT_FONT "c:/winnt/fonts/cour.ttf" diff --git a/program/libraries/freetype-2.0.5/freetype.dsp b/program/libraries/freetype-2.0.5/freetype.dsp index 50ad9f77..5262a5ee 100644 --- a/program/libraries/freetype-2.0.5/freetype.dsp +++ b/program/libraries/freetype-2.0.5/freetype.dsp @@ -41,8 +41,8 @@ RSC=rc.exe # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /W3 /GX /I "include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FD /c -# SUBTRACT CPP /O /YX +# ADD CPP /nologo /MT /W3 /GX /I "include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FD /c +# SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /i "include" /d "NDEBUG" BSC32=bscmake.exe @@ -65,7 +65,7 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /ML /W3 /Gm /GX /ZI /Od /I "include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FD /GZ /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" diff --git a/program/libraries/libart_lgpl-2.3.7/libart.dsp b/program/libraries/libart_lgpl-2.3.7/libart.dsp index 14633f1b..9c1665f6 100644 --- a/program/libraries/libart_lgpl-2.3.7/libart.dsp +++ b/program/libraries/libart_lgpl-2.3.7/libart.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 "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /W3 /GX /I "..\..\confignt" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "LIBART_COMPILATION" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /I "..\..\confignt" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "LIBART_COMPILATION" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -64,7 +64,7 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /ML /W3 /Gm /GX /ZI /Od /I "..\..\confignt" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "LIBART_COMPILATION" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\confignt" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "LIBART_COMPILATION" /YX /FD /GZ /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe diff --git a/program/libraries/libpng-1.2.0/png.dsp b/program/libraries/libpng-1.2.0/png.dsp index 7a8ebd5c..85491e5b 100644 --- a/program/libraries/libpng-1.2.0/png.dsp +++ b/program/libraries/libpng-1.2.0/png.dsp @@ -41,8 +41,7 @@ RSC=rc.exe # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /W3 /GX /I "..\zlib-1.1.3" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# SUBTRACT CPP /O +# ADD CPP /nologo /MT /W3 /GX /I "..\zlib-1.1.3" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -65,7 +64,7 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /ML /W3 /Gm /GX /ZI /Od /I "..\zlib-1.1.3" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\zlib-1.1.3" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe diff --git a/program/libraries/zlib-1.1.4/zlib.dsp b/program/libraries/zlib-1.1.4/zlib.dsp index c4438292..a3357c6b 100644 --- a/program/libraries/zlib-1.1.4/zlib.dsp +++ b/program/libraries/zlib-1.1.4/zlib.dsp @@ -41,8 +41,7 @@ RSC=rc.exe # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /W3 /GX /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# SUBTRACT CPP /O +# ADD CPP /nologo /MT /W3 /GX /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -65,7 +64,7 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /ML /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe diff --git a/program/src/rrd.dsp b/program/src/rrd.dsp index c0a8ab30..d40a217e 100644 --- a/program/src/rrd.dsp +++ b/program/src/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 /W3 /GX /I "..\libraries\libpng-1.2.0" /I "..\libraries\zlib-1.1.4" /I "..\libraries\libart_lgpl-2.3.7" /I "..\libraries\freetype-2.0.5\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_CTYPE_DISABLE_MACROS" /FD /c +# ADD CPP /nologo /MT /W3 /GX /I "..\libraries\libpng-1.2.0" /I "..\libraries\zlib-1.1.4" /I "..\libraries\libart_lgpl-2.3.7" /I "..\libraries\freetype-2.0.5\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 0x100c @@ -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 /ML /W3 /Gm /GX /ZI /Od /I "..\libraries\libpng-1.2.0" /I "..\libraries\zlib-1.1.4" /I "..\libraries\libart_lgpl-2.3.7" /I "..\libraries\freetype-2.0.5\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_CTYPE_DISABLE_MACROS" /FR /FD /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\libraries\libpng-1.2.0" /I "..\libraries\zlib-1.1.4" /I "..\libraries\libart_lgpl-2.3.7" /I "..\libraries\freetype-2.0.5\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 0x100c diff --git a/program/src/rrd_open.c b/program/src/rrd_open.c index cf663ed3..c0e6545a 100644 --- a/program/src/rrd_open.c +++ b/program/src/rrd_open.c @@ -5,6 +5,9 @@ ***************************************************************************** * $Id$ * $Log$ + * Revision 1.5 2002/06/20 00:21:03 jake + * More Win32 build changes; thanks to Kerry Calvert. + * * Revision 1.4 2002/02/01 20:34:49 oetiker * fixed version number and date/time * @@ -131,6 +134,14 @@ void rrd_free(rrd_t *rrd) free(rrd->rrd_value); } +/* routine used by external libraries to free memory allocated by + * rrd library */ +void rrd_freemem(void *mem) +{ + + free(mem); +} + int readfile(char *file_name, char **buffer, int skipfirst){ long writecnt=0,totalcnt = MEMBLK; FILE *input=NULL; diff --git a/program/src/rrd_tool.h b/program/src/rrd_tool.h index 7280e744..f21a17a7 100644 --- a/program/src/rrd_tool.h +++ b/program/src/rrd_tool.h @@ -160,6 +160,7 @@ int rrd_fetch_fn(char *filename, enum cf_en cf_idx, rrd_value_t **data); void rrd_free(rrd_t *rrd); +void rrd_freemem(void *mem); void rrd_init(rrd_t *rrd); int rrd_open(char *file_name, FILE **in_file, rrd_t *rrd, int rdwr); diff --git a/program/src/rrdtool.dsp b/program/src/rrdtool.dsp index b64e04f6..ecffcc7b 100644 --- a/program/src/rrdtool.dsp +++ b/program/src/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 /W3 /GX /I "..\libraries\libpng-1.2.0" /I "..\libraries\zlib-1.1.4" /I "..\libraries\libart_lgpl-2.3.7" /I "..\libraries\freetype-2.0.5\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_CTYPE_DISABLE_MACROS" /FD /c +# ADD CPP /nologo /MT /W3 /GX /I "..\libraries\libpng-1.2.0" /I "..\libraries\zlib-1.1.4" /I "..\libraries\libart_lgpl-2.3.7" /I "..\libraries\freetype-2.0.5\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_CTYPE_DISABLE_MACROS" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x100c /d "NDEBUG" # ADD RSC /l 0x100c /d "NDEBUG" @@ -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 /ML /W3 /Gm /GX /ZI /Od /I "..\libraries\libpng-1.2.0" /I "..\libraries\zlib-1.1.4" /I "..\libraries\libart_lgpl-2.3.7" /I "..\libraries\freetype-2.0.5\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_CTYPE_DISABLE_MACROS" /FR /FD /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\libraries\libpng-1.2.0" /I "..\libraries\zlib-1.1.4" /I "..\libraries\libart_lgpl-2.3.7" /I "..\libraries\freetype-2.0.5\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_CTYPE_DISABLE_MACROS" /FR /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x100c /d "_DEBUG" # ADD RSC /l 0x100c /d "_DEBUG" diff --git a/program/src/rrdtool.ncb b/program/src/rrdtool.ncb deleted file mode 100644 index eb35de8f..00000000 Binary files a/program/src/rrdtool.ncb and /dev/null differ