add perlbindings and optional export filename to rrd_dump -- Nicola Worthington nicol...
[rrdtool.git] / src / Makefile.NetWare
index 17320c0..c01e73d 100644 (file)
@@ -1,20 +1,25 @@
-# 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
 
+# Vertical label angle: 90.0 (default) or 270.0
+RRDGRAPH_YLEGEND_ANGLE = 90.0
+
 # Edit the path below to point to your Novell NDK.
 ifndef NDKBASE
 NDKBASE        = c:/novell
@@ -25,7 +30,7 @@ INSTDIR       = s:/mrtg/rrd
 
 # Base for the lib sources
 ifndef LIBBASE
-LIBBASE        = d:/projects/cw
+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.
@@ -42,7 +47,7 @@ LIBFT2        = $(LIBBASE)/freetype-2.1.9
 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
@@ -50,8 +55,7 @@ ZLIBSDK       = $(LIBBASE)/zlib-1.2.3
 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.
@@ -67,7 +71,7 @@ else
        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
@@ -90,17 +94,15 @@ endif
 
 # 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
@@ -112,7 +114,8 @@ endif
 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
@@ -137,7 +140,7 @@ ifdef XDCOPT
        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
@@ -148,15 +151,14 @@ NDK_ROOT = $(NDKBASE)/ndk
 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)
@@ -198,7 +200,6 @@ XLIBOBJS    = \
        $(OBJDIR)/hash_32.o \
        $(OBJDIR)/parsetime.o \
        $(OBJDIR)/pngsize.o \
-       $(OBJDIR)/strftime.o \
        $(EOLIST)
 
 GD2LIBOBJS     = \
@@ -258,19 +259,28 @@ ZLIBOBJS  += \
        $(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
@@ -279,7 +289,7 @@ dist: all
 
 install: all
        @[ -d $(INSTDIR) ] || mkdir $(INSTDIR)
-       @$(CP) $(TARGET).nlm $(INSTDIR)
+       @$(CP) $(TARGET).$(BINEXT) $(INSTDIR)
 
 clean:
        -$(RM) -r $(OBJDIR)
@@ -292,11 +302,11 @@ $(OBJDIR)/%.o: %.c
        @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
@@ -358,7 +368,7 @@ ifdef XDCDATA
        @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
@@ -380,6 +390,7 @@ config.h: Makefile.NetWare
        @echo $(DL)#define HAVE_ERRNO_H 1$(DL) >> $@
        @echo $(DL)#define HAVE_FCNTL_H 1$(DL) >> $@
        @echo $(DL)#define HAVE_FIONBIO 1$(DL) >> $@
+       @echo $(DL)#define HAVE_FLOAT_H 1$(DL) >> $@
        @echo $(DL)#define HAVE_GETTIMEOFDAY 1$(DL) >> $@
        @echo $(DL)#define HAVE_INTTYPES_H 1$(DL) >> $@
        @echo $(DL)#define HAVE_LIMITS_H 1$(DL) >> $@
@@ -388,7 +399,10 @@ config.h: Makefile.NetWare
        @echo $(DL)#define HAVE_MALLOC_H 1$(DL) >> $@
        @echo $(DL)#define HAVE_MATH_H 1$(DL) >> $@
        @echo $(DL)#define HAVE_MBSTOWCS 1$(DL) >> $@
+       @echo $(DL)#define HAVE_MEMMOVE 1$(DL) >> $@
+       @echo $(DL)#define HAVE_MKTIME 1$(DL) >> $@
        @echo $(DL)#define HAVE_SELECT 1$(DL) >> $@
+       @echo $(DL)#define HAVE_SETLOCALE 1$(DL) >> $@
        @echo $(DL)#define HAVE_SETJMP_H 1$(DL) >> $@
 #      @echo $(DL)#define HAVE_SIGNAL 1$(DL) >> $@
        @echo $(DL)#define HAVE_SNPRINTF 1$(DL) >> $@
@@ -407,15 +421,20 @@ config.h: Makefile.NetWare
        @echo $(DL)#define HAVE_SYS_SELECT_H 1$(DL) >> $@
        @echo $(DL)#define HAVE_SYS_STAT_H 1$(DL) >> $@
        @echo $(DL)#define HAVE_SYS_TIME_H 1$(DL) >> $@
+       @echo $(DL)#define HAVE_SYS_TYPES_H 1$(DL) >> $@
        @echo $(DL)#define HAVE_TERMIOS_H 1$(DL) >> $@
        @echo $(DL)#define HAVE_TIME_H 1$(DL) >> $@
+       @echo $(DL)#define HAVE_TZSET 1$(DL) >> $@
        @echo $(DL)#define HAVE_UNAME 1$(DL) >> $@
+       @echo $(DL)#define HAVE_VPRINTF 1$(DL) >> $@
        @echo $(DL)#define HAVE_UNISTD_H 1$(DL) >> $@
        @echo $(DL)#define STDC_HEADERS 1$(DL) >> $@
        @echo $(DL)#define TIME_WITH_SYS_TIME 1$(DL) >> $@
        @echo $(DL)#define HAVE_ZLIB_H 1$(DL) >> $@
        @echo $(DL)#define HAVE_LIBZ 1$(DL) >> $@
        @echo $(DL)#define rrd_realloc(a,b) realloc((a), (b))$(DL) >> $@
-       @echo $(DL)#define RRDGRAPH_YLEGEND_ANGLE 90.0$(DL) >> $@
+#      @echo $(DL)#define rrd_realloc(a,b) ( (a) == NULL ? malloc( (b) ) : realloc( (a) , (b) ))$(DL) >> $@
+       @echo $(DL)#define RRDGRAPH_YLEGEND_ANGLE $(RRDGRAPH_YLEGEND_ANGLE)$(DL) >> $@
+       @echo $(DL)#define RRD_DEFAULT_FONT "arial.ttf"$(DL) >> $@