NWGNUenvironment.inc revision cfb941e9ad5276eef7bc8f3eedcd270f30cfec35
9512fe850e98fdd448c638ca63fdd92a8a510255ahl#
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# Setup needed Tools and Libraries
9512fe850e98fdd448c638ca63fdd92a8a510255ahl#
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahlifeq "$(wildcard $(AP_WORK)\NWGNUcustom.ini)" "$(AP_WORK)\NWGNUcustom.ini"
9512fe850e98fdd448c638ca63fdd92a8a510255ahlinclude $(AP_WORK)\NWGNUcustom.ini
9512fe850e98fdd448c638ca63fdd92a8a510255ahlCUSTOM_INI = $(AP_WORK)\NWGNUcustom.ini
9512fe850e98fdd448c638ca63fdd92a8a510255ahlendif
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahlifndef VERBOSE
9512fe850e98fdd448c638ca63fdd92a8a510255ahl.SILENT:
9512fe850e98fdd448c638ca63fdd92a8a510255ahlendif
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahl#
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# Treat like an include
9512fe850e98fdd448c638ca63fdd92a8a510255ahl#
9512fe850e98fdd448c638ca63fdd92a8a510255ahlifndef EnvironmentDefined
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahl#
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# simple macros for parsing makefiles
9512fe850e98fdd448c638ca63fdd92a8a510255ahl#
9512fe850e98fdd448c638ca63fdd92a8a510255ahlEOLIST:=
9512fe850e98fdd448c638ca63fdd92a8a510255ahlEMPTY :=
9512fe850e98fdd448c638ca63fdd92a8a510255ahlCOMMA := ,
9512fe850e98fdd448c638ca63fdd92a8a510255ahlSPACE := $(EMPTY) $(EMPTY)
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahl#
23b5c241225a8ade2b6b9f06ebb891ee459e3b02tomee# Base environment
23b5c241225a8ade2b6b9f06ebb891ee459e3b02tomee#
23b5c241225a8ade2b6b9f06ebb891ee459e3b02tomee
23b5c241225a8ade2b6b9f06ebb891ee459e3b02tomee# Try and handle case issues
23b5c241225a8ade2b6b9f06ebb891ee459e3b02tomeeifndef NOVELLLIBC
23b5c241225a8ade2b6b9f06ebb891ee459e3b02tomeeifdef NovellLibC
9512fe850e98fdd448c638ca63fdd92a8a510255ahlNOVELLLIBC = $(NovellLibC)
9512fe850e98fdd448c638ca63fdd92a8a510255ahlendif
9512fe850e98fdd448c638ca63fdd92a8a510255ahlendif
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahlifndef NOVELLLIBC
9512fe850e98fdd448c638ca63fdd92a8a510255ahlNOVELLLIBC = C:/novell/ndk/libc
9512fe850e98fdd448c638ca63fdd92a8a510255ahlendif
9512fe850e98fdd448c638ca63fdd92a8a510255ahlifneq "$(wildcard $(NOVELLLIBC)/include/ndkvers.h)" "$(NOVELLLIBC)/include/ndkvers.h"
9512fe850e98fdd448c638ca63fdd92a8a510255ahl$(error NOVELLLIBC does not point to a valid Novell LIBC SDK)
9512fe850e98fdd448c638ca63fdd92a8a510255ahlendif
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
23b5c241225a8ade2b6b9f06ebb891ee459e3b02tomeeifndef LDAPSDK
9512fe850e98fdd448c638ca63fdd92a8a510255ahlLDAPSDK = C:/novell/ndk/cldapsdk/NetWare/libc
9512fe850e98fdd448c638ca63fdd92a8a510255ahlendif
9512fe850e98fdd448c638ca63fdd92a8a510255ahlifneq "$(wildcard $(LDAPSDK)/inc/ldap.h)" "$(LDAPSDK)/inc/ldap.h"
9512fe850e98fdd448c638ca63fdd92a8a510255ahl$(error LDAPSDK does not point to a valid Novell CLDAP SDK)
9512fe850e98fdd448c638ca63fdd92a8a510255ahlendif
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahlifndef PCRESRC
9512fe850e98fdd448c638ca63fdd92a8a510255ahlifeq "$(wildcard $(AP_WORK)/srclib/pcre/pcre.in)" "$(AP_WORK)/srclib/pcre/pcre.in"
9512fe850e98fdd448c638ca63fdd92a8a510255ahlPCRESRC = $(AP_WORK)/srclib/pcre
9512fe850e98fdd448c638ca63fdd92a8a510255ahlendif
9512fe850e98fdd448c638ca63fdd92a8a510255ahlendif
9512fe850e98fdd448c638ca63fdd92a8a510255ahlifneq "$(wildcard $(PCRESRC)/pcre.in)" "$(PCRESRC)/pcre.in"
9512fe850e98fdd448c638ca63fdd92a8a510255ahl$(error PCRESRC does not point to a valid PCRE source tree)
9512fe850e98fdd448c638ca63fdd92a8a510255ahlendif
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# This is a placeholder
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# ifndef ZLIBSDK
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# ZLIBSDK = C:/novell/ndk/zlibsdk
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# endif
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahlifndef METROWERKS
a386cc11a86ecb60f5a48078d22c1500e2ad003eRobert MustacchiMETROWERKS = C:\Program Files\Metrowerks\CodeWarrior
9512fe850e98fdd448c638ca63fdd92a8a510255ahlendif
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# If LM_LICENSE_FILE isn't defined, define a variable that can be used to
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# restart make with it defined
23b5c241225a8ade2b6b9f06ebb891ee459e3b02tomeeifndef LM_LICENSE_FILE
9512fe850e98fdd448c638ca63fdd92a8a510255ahlNO_LICENSE_FILE = NO_LICENSE_FILE
9512fe850e98fdd448c638ca63fdd92a8a510255ahlendif
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahl#
a386cc11a86ecb60f5a48078d22c1500e2ad003eRobert Mustacchi# Set the Release type that you want to build, possible values are:
9512fe850e98fdd448c638ca63fdd92a8a510255ahl#
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# debug - full debug switches are set
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# noopt - normal switches are set
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# release - optimization switches are set (default)
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahlifdef reltype
23b5c241225a8ade2b6b9f06ebb891ee459e3b02tomeeRELEASE = $(reltype)
9512fe850e98fdd448c638ca63fdd92a8a510255ahlendif
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahlifdef RELTYPE
9512fe850e98fdd448c638ca63fdd92a8a510255ahlRELEASE = $(RELTYPE)
9512fe850e98fdd448c638ca63fdd92a8a510255ahlendif
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahlifdef debug
9512fe850e98fdd448c638ca63fdd92a8a510255ahlRELEASE = debug
9512fe850e98fdd448c638ca63fdd92a8a510255ahlendif
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahlifdef DEBUG
9512fe850e98fdd448c638ca63fdd92a8a510255ahlRELEASE = debug
9512fe850e98fdd448c638ca63fdd92a8a510255ahlendif
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
ifdef noopt
RELEASE = noopt
endif
ifdef NOOPT
RELEASE = noopt
endif
ifdef optimized
RELEASE = release
endif
ifdef OPTIMIZED
RELEASE = release
endif
ifndef RELEASE
RELEASE = release
endif
OBJDIR = obj_$(RELEASE)
#
# Setup compiler information
#
# MetroWerks NLM tools
CC = mwccnlm
CPP = mwccnlm
LINK = mwldnlm
LIB = mwldnlm -type library -w nocmdline
WIN_CC = mwcc
# Setup build tools
AWK = awk
# Define minimum APR version to check for
APR_WANTED = 1004000
ifdef IPV6
ifndef USE_STDSOCKETS
USE_STDSOCKETS=1
endif
endif
NOVI = $(NOVELLLIBC)\imports
INCDIRS = $(NOVELLLIBC)\include;$(NOVELLLIBC)\include\nks;$(NOVELLLIBC)\include\winsock;
ifneq "$(LDAPSDK)" ""
INCDIRS := $(INCDIRS);$(LDAPSDK)/inc
endif
ifneq "$(ZLIBSDK)" ""
INCDIRS := $(INCDIRS);$(ZLIBSDK)
endif
ifneq "$(PCRESRC)" ""
INCDIRS := $(INCDIRS);$(PCRESRC)
endif
DEFINES = -DNETWARE
ifndef USE_STDSOCKETS
DEFINES += -DUSE_WINSOCK
endif
ifndef DEBUG
DEFINES += -DNDEBUG
endif
ifdef USE_STDSOCKETS
VERSION_SKT = (BSDSOCK)
else
VERSION_SKT = (WINSOCK)
endif
# MetroWerks static Libraries
CLIB3S = $(METROWERKS)\Novell Support\Metrowerks Support\Libraries\Runtime\mwcrtl.lib
MATH3S =
PLIB3S = $(METROWERKS)\Novell Support\Metrowerks Support\Libraries\MSL C++\MWCPP.lib
# MetroWerks Win32 build flags to create build tool
MWCW_MSL = "$(METROWERKS)/MSL"
MWCW_W32 = "$(METROWERKS)/Win32-x86 Support"
WIN_CFLAGS = -O2 -gccinc -nodefaults -proc 586 -w off
WIN_CFLAGS += -ir $(MWCW_MSL) -ir $(MWCW_W32) -lr $(MWCW_MSL) -lr $(MWCW_W32)
WIN_CFLAGS += -lMSL_All_x86.lib -lkernel32.lib -luser32.lib
# Base compile flags
# and prefix or precompiled header added here.
# The default flags are as follows:
#
# -c compile only, no link
# -nosyspath treat #include <...> like #include "..."
# -Cpp_exceptions off disable C++ exceptions
# -RTTI off disable C++ run-time typing information
# -align 4 align on 4 byte bounderies
# -w nocmdline disable command-line driver/parser warnings
# -proc PII generate code base on Pentium II instruction set
# -inst mmx use MMX extensions (Not used)
CFLAGS = -c -nosyspath -Cpp_exceptions off -RTTI off -align 4 -w nocmdline -proc PII
# -g generate debugging information
# -O0 level 0 optimizations
ifeq "$(RELEASE)" "debug"
CFLAGS += -g -O0
endif
# -O4,p level 4 optimizations, optimize for speed
ifeq "$(RELEASE)" "release"
CFLAGS += -O4,p
endif
# -prefix pre_nw.h #include pre_nw.h for all files
CFLAGS += -prefix pre_nw.h
PATH:=$(PATH);$(METROWERKS)\bin;$(METROWERKS)\Other Metrowerks Tools\Command Line Tools
#
# Declare major project deliverables output directories here
#
ifdef DEST
INSTALL = $(DEST)
ifeq (\, $(findstring \,$(INSTALL)))
INSTDIRS = $(DEST)
endif
endif
ifdef dest
INSTALL = $(dest)
ifeq (\, $(findstring \,$(INSTALL)))
INSTDIRS = $(dest)
endif
endif
ifndef INSTALL
INSTALL = $(AP_WORK)\Dist
INSTDIRS = $(AP_WORK)\Dist
endif
ifndef BASEDIR
BASEDIR = Apache23
export BASEDIR
endif
ifndef PORT
PORT = 80
endif
ifndef SSLPORT
SSLPORT = 443
endif
# Add support for building IPV6 alongside
ifneq "$(IPV6)" ""
DEFINES += -DNW_BUILD_IPV6
# INCDIRS := $(NOVELLLIBC)\include\winsock\IPV6;$(INCDIRS)
ifneq "$(findstring IPV6,$(OBJDIR))" "IPV6"
OBJDIR := $(OBJDIR)_IPV6
endif
ifneq "$(findstring IPV6,$(INSTALL))" "IPV6"
INSTALL := $(INSTALL)_IPV6
endif
ifneq "$(findstring IPV6,$(INSTDIRS))" "IPV6"
INSTDIRS := $(INSTDIRS)_IPV6
endif
endif
INSTDEVDIRS := \
$(INSTDIRS) \
$(INSTALL)\$(BASEDIR)\include \
$(INSTALL)\$(BASEDIR)\lib \
INSTDIRS += \
$(INSTALL)\$(BASEDIR) \
$(INSTALL)\$(BASEDIR)\bin \
$(INSTALL)\$(BASEDIR)\cgi-bin \
$(INSTALL)\$(BASEDIR)\conf \
$(INSTALL)\$(BASEDIR)\error \
$(INSTALL)\$(BASEDIR)\htdocs \
$(INSTALL)\$(BASEDIR)\icons \
$(INSTALL)\$(BASEDIR)\logs \
$(INSTALL)\$(BASEDIR)\man \
$(INSTALL)\$(BASEDIR)\manual \
$(INSTALL)\$(BASEDIR)\modules \
#
# Declare Command and tool macros here
#
# Os2LibPath is an extra check to see if we are on NT
ifdef Os2LibPath
OS = Windows_NT
endif
ifeq "$(OS)" "Windows_NT"
CMD = cmd /C
DEL = del /F
DELTREE = rd /s/q
WINNT = 1
XCOPYSW = /E
else
CMD = command /C
DEL = del
DELTREE = deltree /y
XCOPYSW = /E /Y
endif
CHK = $(CMD) if exist
CHKNOT = $(CMD) if not exist
#
# Setup base C compiler flags
#
#
# Common directories
#
STDMOD = $(AP_WORK)/modules
NWOS = $(AP_WORK)/os/netware
SERVER = $(AP_WORK)/server
SRC = $(AP_WORK)
APR = $(APR_WORK)
APRUTIL = $(APU_WORK)
APULDAP = $(APU_WORK)/ldap
SUPMOD = $(AP_WORK)/support
PCRE = $(PCRESRC)
APRTEST = $(APR_WORK)/test
HTTPD = $(AP_WORK)/modules/http
XML = $(APU_WORK)/xml
PREBUILD_INST = $(AP_WORK)/nwprebuild
#
# Internal Libraries
#
APRLIB = $(APR)/$(OBJDIR)/aprlib.lib
APRUTLIB = $(APRUTIL)/$(OBJDIR)/aprutil.lib
APULDAPLIB = $(APULDAP)/$(OBJDIR)/apuldap.lib
STMODLIB = $(STDMOD)/$(OBJDIR)/stdmod.lib
PCRELIB = $(PCRE)/$(OBJDIR)/pcre.lib
NWOSLIB = $(NWOS)/$(OBJDIR)/netware.lib
SERVLIB = $(SERVER)/$(OBJDIR)/server.lib
HTTPDLIB = $(HTTPD)/$(OBJDIR)/httpd.lib
XMLLIB = $(XML)/$(OBJDIR)/xmllib.lib
#
# Additional general defines
#
EnvironmentDefined = 1
endif # ifndef EnvironmentDefined
# This is always set so that it will show up in lower directories
ifdef Path
Path = $(PATH)
endif