summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9391a79)
raw | patch | inline | side by side (parent: 9391a79)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Wed, 4 Jan 2006 22:07:46 +0000 (22:07 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Wed, 4 Jan 2006 22:07:46 +0000 (22:07 +0000) |
program/src/Makefile.NetWare | patch | blob | history | |
program/src/Makefile.Win32 | patch | blob | history | |
program/src/get_ver.awk | patch | blob | history | |
program/src/rrd_tool.h | patch | blob | history |
index 417c40a0f7112b503ce06fa0fb772d7309ec15cd..c01e73d1ec8e17cf8c0b9945b183ed600e5b52ca 100644 (file)
-# Gnu Makefile for NetWare target * 20-Aug-2005
+# Gnu Makefile for NetWare target * 04-Jan-2006
# for use with gcc/nlmconv or Metrowerks CodeWarrior compiler
-# use with: make -f Makefile.NetWare [all|clean|dist]
+# use with: make -f Makefile.NetWare [all|clean|dist] [BINEXT=cgi]
+
+# What to build
+ifndef BINEXT
+BINEXT = nlm
+endif
-SOURCE = rrd_tool
-#SOURCE = rrd_cgi
-TARGET = $(subst _,,$(SOURCE))
DESCR = Round Robin Database Tool $(RRD_VERSION_STR)
-COPYR = Copyright (c) 1997-2005 by Tobias Oetiker
+COPYR = Copyright (c) 1997-2006 by Tobias Oetiker
#WWWURL = http://ee-staff.ethz.ch/~oetiker/webtools/rrdtool/
WWWURL = http://www.rrdtool.org/
MTSAFE = YES
#SCREEN = $(TARGET)
-STACK = 49152
+STACK = 65535
# Comment the line below if you dont want to load protected automatically.
#LDRING = 3
# Base for the lib sources
ifndef LIBBASE
-LIBBASE = ..
+LIBBASE = ../..
endif
# All library code is statically linked to avoid problems with other lib NLMs.
# Edit the path below to point to your libgd sources or set environment var.
endif
# Edit the path below to point to your freetype sources or set environment var.
ifndef LIBART
-LIBART = $(LIBBASE)/libart_lgpl-2.3.3
+LIBART = $(LIBBASE)/libart_lgpl-2.3.17
endif
# Edit the path below to point to your zlib sources or set environment var.
ifndef ZLIBSDK
endif
# Edit the path below to point to your zlib sources or set environment var.
ifndef LIBCGI
-#LIBCGI = $(LIBBASE)/cgilib-0.4
-LIBCGI = d:/rrdtool-1.0.50/cgilib-0.4
+LIBCGI = $(LIBBASE)/cgilib-0.5
endif
# Edit the var below to point to your lib architecture.
CC = gcc
endif
# RM = rm -f
-CP = cp -fv
+CP = cp -afv
# if you want to mark the target as MTSAFE you will need a tool for
# generating the xdc data for the linker; here's a minimal tool:
# http://www.gknw.com/development/prgtools/mkxdc.zip
# Global flags for all compilers
CFLAGS = $(OPT) -D$(DB) -nostdinc -DNETWARE -DN_PLAT_NLM -D_POSIX_SOURCE
-CFLAGS += -DHAVE_CONFIG_H=1
-#CFLAGS += -DHAVE_LIBPNG
-
-CP = cp -af
+CFLAGS += -DHAVE_CONFIG_H
ifeq ($(CC),mwccnlm)
LD = mwldnlm
-LDFLAGS = -nostdlib $(PRELUDE) $(OBJS) $(LIBS) -o $(OBJDIR)/$(TARGET).nlm -commandfile
+LDFLAGS = -nostdlib $(PRELUDE) $(OBJS) $(LDLIBS) -o $(OBJDIR)/$(TARGET).nlm -commandfile
+LIBEXT = lib
CFLAGS += -gccinc -inline off -opt nointrinsics -proc 586
CFLAGS += -relax_pointers
-#CFLAGS += -w on,nounused,nounusedexpr -ansi strict
+#CFLAGS += -w on,nounused,nounusedexpr # -ansi strict
ifeq ($(LIBARCH),LIBC)
PRELUDE = $(SDK_LIBC)/imports/libcpre.o
CFLAGS += -align 4
else
LD = nlmconv
LDFLAGS = -T
-CFLAGS += -fno-builtin -fpack-struct -fpcc-struct-return
+LIBEXT = a
+CFLAGS += -fno-builtin -fpack-struct -fpcc-struct-return -fno-strict-aliasing
CFLAGS += -Wall -Wno-unused # -pedantic
ifeq ($(LIBARCH),LIBC)
PRELUDE = $(SDK_LIBC)/imports/libcpre.gcc.o
XDCDATA = $(OBJDIR)/$(TARGET).xdc
endif
ifndef COPYR
- COPYR = Copyright (c) 2005 The Open Source Community.
+ COPYR = Copyright (c) 2006 The Open Source Community.
endif
ifndef DESCR
DESCR = $(TARGET) Command Extension
SDK_CLIB = $(NDK_ROOT)/nwsdk
SDK_LIBC = $(NDK_ROOT)/libc
+INCLUDES = -I. -I$(LIBGD) -I$(LIBPNG) -I$(LIBFT2)/include -I$(LIBART) -I$(ZLIBSDK)
+ifeq ($(BINEXT),cgi)
+INCLUDES += -I$(LIBCGI)
+endif
ifeq ($(LIBARCH),LIBC)
- INCLUDES = -I$(SDK_LIBC)/include -I$(SDK_LIBC)/include/nks
+ INCLUDES += -I$(SDK_LIBC)/include -I$(SDK_LIBC)/include/nks
else
- INCLUDES = -I$(SDK_CLIB)/include/nlm -I$(SDK_CLIB)/include
-endif
-
-INCLUDES += -I. -I$(LIBGD) -I$(LIBPNG) -I$(LIBFT2)/include -I$(LIBART) -I$(ZLIBSDK)
-ifeq ($(SOURCE),rrd_cgi)
-INCLUDES += -I$(LIBCGI)
+ INCLUDES += -I$(SDK_CLIB)/include/nlm -I$(SDK_CLIB)/include
endif
CFLAGS += $(INCLUDES)
$(EOLIST)
endif
+CGIOBJS = \
+ $(OBJDIR)/cgi.o \
+ $(OBJDIR)/cookies.o \
+ $(EOLIST)
+
ARTLIBOBJS = \
$(patsubst $(LIBART)/libart_lgpl/%.c,$(OBJDIR)/%.o,$(wildcard $(LIBART)/libart_lgpl/art_*.c))
OBJS = $(RRDLIBOBJS) $(XLIBOBJS) $(GD2LIBOBJS) $(PNGLIBOBJS) $(ARTLIBOBJS) $(ZLIBOBJS)
-ifeq ($(SOURCE),rrd_cgi)
-OBJS += $(OBJDIR)/cgi.o
+
+ifeq ($(BINEXT),cgi)
+OBJS += $(CGIOBJS) $(OBJDIR)/rrd_cgi.o
+TARGET = rrdcgi
+else
+OBJS += $(OBJDIR)/rrd_tool.o
+TARGET = rrdtool
endif
-OBJS += $(OBJDIR)/$(SOURCE).o
-LIBS = $(LIBFT2)/builds/netware/libc/libft2.lib
+LDLIBS += $(LIBFT2)/builds/netware/libc/libft2.$(LIBEXT)
-all: $(OBJDIR) config.h $(OBJDIR)/$(TARGET).nlm
+all: $(OBJDIR) config.h $(OBJDIR)/$(TARGET).$(BINEXT)
dist: all
-$(RM) $(OBJDIR)/*.o $(OBJDIR)/$(TARGET).map $(OBJDIR)/$(TARGET).ncv
install: all
@[ -d $(INSTDIR) ] || mkdir $(INSTDIR)
- @$(CP) $(TARGET).nlm $(INSTDIR)
+ @$(CP) $(TARGET).$(BINEXT) $(INSTDIR)
clean:
-$(RM) -r $(OBJDIR)
@echo Compiling $<
@$(CC) $(CFLAGS) -c $< -o $@
-$(OBJDIR)/version.inc: ../configure $(OBJDIR) get_ver.awk
+$(OBJDIR)/version.inc: ../configure.ac $(OBJDIR) get_ver.awk
@echo Creating $@
@awk -f get_ver.awk $< > $@
-$(OBJDIR)/$(TARGET).nlm: $(OBJDIR) $(OBJS) $(OBJDIR)/version.inc $(OBJDIR)/$(TARGET).def $(XDCDATA)
+$(OBJDIR)/$(TARGET).$(BINEXT): $(OBJDIR) $(OBJS) $(OBJDIR)/version.inc $(OBJDIR)/$(TARGET).def $(XDCDATA)
@echo Linking $@
@-$(RM) $@
@$(LD) $(LDFLAGS) $(OBJDIR)/$(TARGET).def
@echo $(DL)xdcdata $(XDCDATA)$(DL) >> $@
endif
ifeq ($(LD),nlmconv)
- @echo $(DL)input $(OBJS) $(LIBS)$(DL) >> $@
+ @echo $(DL)input $(OBJS) $(LDLIBS)$(DL) >> $@
@echo $(DL)input $(PRELUDE)$(DL) >> $@
@echo $(DL)output $(TARGET).nlm$(DL) >> $@
endif
index b58522de7436c1813a18556feab1840ac1a0f326..04e40373d2a905ca70df2fbc0698d90e031c2f17 100644 (file)
-# Gnu Makefile for Win32 target * 20-Aug-2005\r
+# Gnu Makefile for Win32 target * 04-Jan-2006\r
# for use with MingW32 gcc or Metrowerks CodeWarrior compiler\r
-# use with: make -f Makefile.Win32 [all|clean|dist]\r
+# use with: make -f Makefile.Win32 [all|clean|dist] [BINEXT=cgi]\r
+\r
+# What to build\r
+ifndef BINEXT\r
+BINEXT = exe\r
+endif\r
\r
-SOURCE = rrd_tool\r
-#SOURCE = rrd_cgi\r
-TARGET = $(subst _,,$(SOURCE))\r
-#DESCR = Round Robin Database Tool $(RRD_VERSION_STR)\r
DESCR = Round Robin Database Tool\r
-COPYR = Copyright (c) 1997-2005 by Tobias Oetiker\r
+COPYR = Copyright (c) 1997-2006 by Tobias Oetiker\r
#WWWURL = http://ee-staff.ethz.ch/~oetiker/webtools/rrdtool/\r
WWWURL = http://www.rrdtool.org/\r
+ICON = ../favicon.ico\r
+\r
+# Vertical label angle: 90.0 (default) or 270.0\r
+RRDGRAPH_YLEGEND_ANGLE = 90.0\r
\r
# Edit the path below to point to your install destination.\r
-# INSTDIR = /mnt/sys/mrtg/rrd\r
INSTDIR = c:/mrtg/rrd\r
\r
# Base for the lib sources\r
ifndef LIBBASE\r
-LIBBASE = d:/projects/cw\r
+LIBBASE = ../..\r
endif\r
# All library code is statically linked to avoid problems with other lib NLMs. \r
# Edit the path below to point to your libgd sources or set environment var.\r
endif\r
# Edit the path below to point to your freetype sources or set environment var.\r
ifndef LIBART\r
-LIBART = $(LIBBASE)/libart_lgpl-2.3.3\r
+LIBART = $(LIBBASE)/libart_lgpl-2.3.17\r
endif\r
# Edit the path below to point to your zlib sources or set environment var.\r
ifndef ZLIBSDK\r
endif\r
# Edit the path below to point to your zlib sources or set environment var.\r
ifndef LIBCGI\r
-#LIBCGI = $(LIBBASE)/cgilib-0.4\r
-LIBCGI = d:/rrdtool-1.0.50/cgilib-0.4\r
+LIBCGI = $(LIBBASE)/cgilib-0.5\r
endif\r
\r
# The following line defines your compiler.\r
CC = gcc\r
endif\r
# RM = rm -f\r
-CP = cp -fv\r
+CP = cp -afv\r
\r
# must be equal to DEBUG or NDEBUG\r
DB = NDEBUG\r
\r
ifeq ($(CC),mwcc)\r
LD = mwld\r
-CFLAGS += -gccinc -msgstyle gcc -inline off -opt nointrinsics -inst mmx -proc 586\r
-#CFLAGS += -w on,nounused,nounusedexpr\r
-#CFLAGS += -ansi strict\r
-CFLAGS += -ir "$(METROWERKS)/MSL" -ir "$(METROWERKS)/Win32-x86 Support"\r
-LD = mwld\r
RC = mwwinrc\r
LDFLAGS = -nostdlib\r
+LIBEXT = lib\r
LIBPATH += -lr "$(METROWERKS)/MSL" -lr "$(METROWERKS)/Win32-x86 Support"\r
LDLIBS += -lkernel32.lib -luser32.lib\r
LDLIBS += -lMSL_Runtime_x86.lib -lMSL_C_x86.lib -lMSL_Extras_x86.lib\r
-LIBEXT = lib\r
RCFLAGS =\r
+CFLAGS += -gccinc -msgstyle gcc -inline off -opt nointrinsics -inst mmx -proc 586\r
+CFLAGS += -ir "$(METROWERKS)/MSL" -ir "$(METROWERKS)/Win32-x86 Support"\r
+#CFLAGS += -w on,nounused,nounusedexpr # -ansi strict\r
else\r
LD = gcc\r
RC = windres\r
LDFLAGS = -s\r
LIBEXT = a\r
RCFLAGS = -I rc -O coff -i\r
-CFLAGS += -fno-strict-aliasing -Wall -Wno-format -Wno-unused # -pedantic\r
+CFLAGS += -fno-strict-aliasing -Wall -Wno-unused # -pedantic\r
endif\r
\r
ifndef COPYR\r
- COPYR = Copyright (c) 2005 The Open Source Community.\r
+ COPYR = Copyright (c) 2006 The Open Source Community.\r
endif\r
ifndef DESCR\r
DESCR = $(TARGET) Command Extension\r
DESCR += - $(CC) build\r
\r
INCLUDES += -I. -I$(LIBGD) -I$(LIBPNG) -I$(LIBFT2)/include -I$(LIBART) -I$(ZLIBSDK)\r
-ifeq ($(SOURCE),rrd_cgi)\r
+ifeq ($(BINEXT),cgi)\r
INCLUDES += -I$(LIBCGI)\r
endif\r
\r
$(EOLIST)\r
endif\r
\r
+CGIOBJS = \\r
+ $(OBJDIR)/cgi.o \\r
+ $(OBJDIR)/cookies.o \\r
+ $(EOLIST)\r
+\r
ARTLIBOBJS = \\r
$(patsubst $(LIBART)/libart_lgpl/%.c,$(OBJDIR)/%.o,$(wildcard $(LIBART)/libart_lgpl/art_*.c))\r
\r
OBJS = $(RRDLIBOBJS) $(XLIBOBJS) $(GD2LIBOBJS) $(PNGLIBOBJS) $(ARTLIBOBJS) $(ZLIBOBJS)\r
-ifeq ($(SOURCE),rrd_cgi)\r
-OBJS += $(OBJDIR)/cgi.o\r
+\r
+ifeq ($(BINEXT),cgi)\r
+OBJS += $(CGIOBJS) $(OBJDIR)/rrd_cgi.o\r
+TARGET = rrdcgi\r
+else\r
+OBJS += $(OBJDIR)/rrd_tool.o\r
+TARGET = rrdtool\r
endif\r
-OBJS += $(OBJDIR)/$(SOURCE).o\r
\r
-LDLIBS = $(LIBFT2)/objs/freetype.$(LIBEXT)\r
+LDLIBS += $(LIBFT2)/objs/freetype.$(LIBEXT)\r
\r
\r
-all: $(OBJDIR) config.h $(OBJDIR)/$(TARGET).exe\r
+all: $(OBJDIR) config.h $(OBJDIR)/$(TARGET).$(BINEXT)\r
\r
dist: all\r
-$(RM) $(OBJDIR)/*.o $(OBJDIR)/$(TARGET).map $(OBJDIR)/$(TARGET).ncv\r
\r
install: all\r
@[ -d $(INSTDIR) ] || mkdir $(INSTDIR)\r
- @$(CP) $(TARGET).exe $(INSTDIR)\r
+ @$(CP) $(TARGET).$(BINEXT) $(INSTDIR)\r
\r
clean:\r
-$(RM) -r $(OBJDIR)\r
$(OBJDIR):\r
@mkdir $(OBJDIR)\r
\r
-$(OBJDIR)/version.inc: ../configure $(OBJDIR) get_ver.awk\r
+$(OBJDIR)/version.inc: ../configure.ac $(OBJDIR) get_ver.awk\r
@echo Creating $@\r
@awk -f get_ver.awk $< > $@\r
\r
@echo Compiling $<\r
@$(CC) $(CFLAGS) -c $< -o $@\r
\r
-$(OBJDIR)/$(TARGET).exe: $(OBJS) $(OBJDIR)/$(TARGET).res\r
+$(OBJDIR)/$(TARGET).$(BINEXT): $(OBJS) $(OBJDIR)/$(TARGET).res\r
@echo Linking $@\r
@-$(RM) $@\r
@$(LD) $(LDFLAGS) $^ -o $@ $(LIBPATH) $(LDLIBS)\r
@echo BEGIN >> $@\r
@echo VALUE "LegalCopyright","$(COPYR)\0" >> $@\r
# @echo VALUE "CompanyName","$(COMPANY)\0" >> $@\r
- @echo VALUE "ProductName","$(TARGET).exe\0" >> $@\r
+ @echo VALUE "ProductName","$(TARGET).$(BINEXT)\0" >> $@\r
@echo VALUE "ProductVersion","$(RRD_VERSION_STR)\0" >> $@\r
@echo VALUE "License","Released under GPL.\0" >> $@\r
@echo VALUE "FileDescription","$(DESCR)\0" >> $@\r
@echo VALUE "FileVersion","$(RRD_VERSION_STR)\0" >> $@\r
@echo VALUE "InternalName","$(TARGET)\0" >> $@\r
- @echo VALUE "OriginalFilename","$(TARGET).exe\0" >> $@\r
+ @echo VALUE "OriginalFilename","$(TARGET).$(BINEXT)\0" >> $@\r
ifdef WWWURL\r
@echo VALUE "WWW","$(WWWURL)\0" >> $@\r
endif\r
@echo $(DL)#define HAVE_TERMIOS_H 1$(DL) >> $@\r
@echo $(DL)#define HAVE_TIME_H 1$(DL) >> $@\r
@echo $(DL)#define HAVE_UNAME 1$(DL) >> $@\r
-# @echo $(DL)#define HAVE_UNISTD_H 1$(DL) >> $@\r
@echo $(DL)#define STDC_HEADERS 1$(DL) >> $@\r
@echo $(DL)#define TIME_WITH_SYS_TIME 1$(DL) >> $@\r
@echo $(DL)#define HAVE_ZLIB_H 1$(DL) >> $@\r
@echo $(DL)#define HAVE_LIBZ 1$(DL) >> $@\r
@echo $(DL)#define rrd_realloc(a,b) realloc((a), (b))$(DL) >> $@\r
- @echo $(DL)#define RRDGRAPH_YLEGEND_ANGLE 90.0$(DL) >> $@\r
+ @echo $(DL)#define RRDGRAPH_YLEGEND_ANGLE $(RRDGRAPH_YLEGEND_ANGLE)$(DL) >> $@\r
+ @echo $(DL)#define RRD_DEFAULT_FONT "arial.ttf"$(DL) >> $@\r
\r
\r
index 5abc22ba43e4c8659a0c4e56c9bcc91f3404cd0d..361294ab80f173c6d378b0ba019507e1a1f3083d 100644 (file)
--- a/program/src/get_ver.awk
+++ b/program/src/get_ver.awk
# fetch rrdtool version number from input file and write them to STDOUT\r
BEGIN {\r
while ((getline < ARGV[1]) > 0) {\r
- if (match ($0, /^PACKAGE_VERSION=/)) {\r
- split($1, t, "=");\r
- my_ver_str = substr(t[2],2,length(t[2])-2);\r
+ if (match ($0, /^AC_INIT/)) {\r
+ split($1, t, ",");\r
+ my_ver_str = substr(t[2],2,length(t[2])-3);\r
split(my_ver_str, v, ".");\r
gsub("[^0-9].*$", "", v[3]);\r
my_ver = v[1] "," v[2] "," v[3];\r
diff --git a/program/src/rrd_tool.h b/program/src/rrd_tool.h
index 350d23eee0cfd84c78741b5778513bb0ad7bc09a..350183b07524d959a5f3eb776637c072a82ba1c6 100644 (file)
--- a/program/src/rrd_tool.h
+++ b/program/src/rrd_tool.h
/* Win32 only includes */
#include <float.h> /* for _isnan */
+#include <io.h> /* for chdir */
#ifdef __MINGW32__
#define localtime_r(a,b) localtime(a)
#define ctime_r(a,b) ctime(a)