NWGNUenvironment.inc revision 09a1167b8cb70e15be9f661f9e83ee33cfe062de
7abe86bacd7821fb83a784398037defc64060a2emanoj#
7abe86bacd7821fb83a784398037defc64060a2emanoj# Setup needed Tools and Libraries
b4a287513d176e4355dd56ea47b27228e0e5d75fjerenkrantz#
b4a287513d176e4355dd56ea47b27228e0e5d75fjerenkrantz
809c98e396829d27f2d9efc0c27f7bb1294381bcgsteinifeq "$(wildcard $(AP_WORK)\NWGNUcustom.ini)" "$(AP_WORK)\NWGNUcustom.ini"
7abe86bacd7821fb83a784398037defc64060a2emanojinclude $(AP_WORK)\NWGNUcustom.ini
cd47196ef7dd7647418fa9b9cb8297cfa614c100rbbCUSTOM_INI = $(AP_WORK)\NWGNUcustom.ini
7bb9fddff37df5cde21b7c4880360f5199875874trawickendif
b4a287513d176e4355dd56ea47b27228e0e5d75fjerenkrantz
b4a287513d176e4355dd56ea47b27228e0e5d75fjerenkrantzifndef VERBOSE
b4a287513d176e4355dd56ea47b27228e0e5d75fjerenkrantz.SILENT:
b4a287513d176e4355dd56ea47b27228e0e5d75fjerenkrantzendif
b4a287513d176e4355dd56ea47b27228e0e5d75fjerenkrantz
b4a287513d176e4355dd56ea47b27228e0e5d75fjerenkrantz#
5f4f0143cfe4e4a74195441b3c9dba4662a7788dniq# Treat like an include
8d09f97dc349d4658d751199b77564a9b09ccec7niq#
b4a287513d176e4355dd56ea47b27228e0e5d75fjerenkrantzifndef EnvironmentDefined
367d146f245f3b1c9f77c18e6ec591b52e0b344cbnicholes
367d146f245f3b1c9f77c18e6ec591b52e0b344cbnicholes#
367d146f245f3b1c9f77c18e6ec591b52e0b344cbnicholes# simple macros for parsing makefiles
367d146f245f3b1c9f77c18e6ec591b52e0b344cbnicholes#
7825bb798c5cdbed5865904896146aea6da1fd52bnicholesEOLIST:=
b4a287513d176e4355dd56ea47b27228e0e5d75fjerenkrantzEMPTY :=
b4a287513d176e4355dd56ea47b27228e0e5d75fjerenkrantzCOMMA := ,
b4a287513d176e4355dd56ea47b27228e0e5d75fjerenkrantzSPACE := $(EMPTY) $(EMPTY)
b4a287513d176e4355dd56ea47b27228e0e5d75fjerenkrantz
b4a287513d176e4355dd56ea47b27228e0e5d75fjerenkrantz#
b4a287513d176e4355dd56ea47b27228e0e5d75fjerenkrantz# Base environment
b4a287513d176e4355dd56ea47b27228e0e5d75fjerenkrantz#
b4a287513d176e4355dd56ea47b27228e0e5d75fjerenkrantz
b4a287513d176e4355dd56ea47b27228e0e5d75fjerenkrantz# Try and handle case issues
84572252cfafd33c91d893b34dec34fcbca34371ndifndef NOVELLLIBC
6c47a7d40935c5508868904cba1e87ca783ec386niqifdef NovellLibC
b4a287513d176e4355dd56ea47b27228e0e5d75fjerenkrantzNOVELLLIBC = $(NovellLibC)
367d146f245f3b1c9f77c18e6ec591b52e0b344cbnicholesendif
367d146f245f3b1c9f77c18e6ec591b52e0b344cbnicholesendif
367d146f245f3b1c9f77c18e6ec591b52e0b344cbnicholes
367d146f245f3b1c9f77c18e6ec591b52e0b344cbnicholesifndef NOVELLLIBC
367d146f245f3b1c9f77c18e6ec591b52e0b344cbnicholesNOVELLLIBC = C:/novell/ndk/libc
480706fbb16436bfdff23c83c8993875ae7ece92minfrinendif
480706fbb16436bfdff23c83c8993875ae7ece92minfrinifneq "$(wildcard $(NOVELLLIBC)/include/ndkvers.h)" "$(NOVELLLIBC)/include/ndkvers.h"
65f6e321663b3fd0f93d8b47b4df05f189de6cf1sf$(error NOVELLLIBC does not point to a valid Novell LIBC SDK)
65f6e321663b3fd0f93d8b47b4df05f189de6cf1sfendif
65f6e321663b3fd0f93d8b47b4df05f189de6cf1sf
65f6e321663b3fd0f93d8b47b4df05f189de6cf1sfifndef LDAPSDK
4726a8c69bfb6a4666875b83dc25f6d2738c3dc4rjungLDAPSDK = C:/novell/ndk/cldapsdk/NetWare/libc
65f6e321663b3fd0f93d8b47b4df05f189de6cf1sfendif
4726a8c69bfb6a4666875b83dc25f6d2738c3dc4rjungifneq "$(wildcard $(LDAPSDK)/inc/ldap.h)" "$(LDAPSDK)/inc/ldap.h"
65f6e321663b3fd0f93d8b47b4df05f189de6cf1sf$(error LDAPSDK does not point to a valid Novell CLDAP SDK)
65f6e321663b3fd0f93d8b47b4df05f189de6cf1sfendif
65f6e321663b3fd0f93d8b47b4df05f189de6cf1sf
65f6e321663b3fd0f93d8b47b4df05f189de6cf1sfifndef PCRESRC
65f6e321663b3fd0f93d8b47b4df05f189de6cf1sfifeq "$(wildcard $(AP_WORK)/srclib/pcre/pcre-config.in)" "$(AP_WORK)/srclib/pcre/pcre-config.in"
65f6e321663b3fd0f93d8b47b4df05f189de6cf1sfPCRESRC = $(AP_WORK)/srclib/pcre
1fc7668ad3646be5c199f967514b7988708b8fb5rpluemendif
f3f5b610c384cae1bb39f069e15e7c62d7d8cd3cwroweendif
480706fbb16436bfdff23c83c8993875ae7ece92minfrinifneq "$(wildcard $(PCRESRC)/pcre-config.in)" "$(PCRESRC)/pcre-config.in"
50cfe8bbbaf4279375802531268e2bf0155215fetrawick$(error PCRESRC does not point to a valid PCRE source tree)
50cfe8bbbaf4279375802531268e2bf0155215fetrawickendif
50cfe8bbbaf4279375802531268e2bf0155215fetrawick
50cfe8bbbaf4279375802531268e2bf0155215fetrawick# This is a placeholder
e684537a0db1085ac01f3743e1630ebe9bfdaf10bnicholes# ifndef ZLIBSDK
e684537a0db1085ac01f3743e1630ebe9bfdaf10bnicholes# ZLIBSDK = C:/novell/ndk/zlibsdk
e684537a0db1085ac01f3743e1630ebe9bfdaf10bnicholes# endif
3340850c6856d1652d190f459aba81b4f350f000jerenkrantz
482ac4a7875bf582690164f70e868508c17f6b87bnicholesifndef METROWERKS
b4a287513d176e4355dd56ea47b27228e0e5d75fjerenkrantzMETROWERKS = C:\Program Files\Metrowerks\CodeWarrior
322b350d0f1ac750b112ec15481a33efc92d182cjerenkrantzendif
e9f8410b788ef1e6f1baed6c706ffdf3da395a16jerenkrantz
306e22b1e932824368f6d9df002f72fb00e70ecdrjung# If LM_LICENSE_FILE isn't defined, define a variable that can be used to
e9f8410b788ef1e6f1baed6c706ffdf3da395a16jerenkrantz# restart make with it defined
7416a4d524cc7456c90a155e06fae5ac6c2d0288trawickifndef LM_LICENSE_FILE
7416a4d524cc7456c90a155e06fae5ac6c2d0288trawickNO_LICENSE_FILE = NO_LICENSE_FILE
7416a4d524cc7456c90a155e06fae5ac6c2d0288trawickendif
7416a4d524cc7456c90a155e06fae5ac6c2d0288trawick
7416a4d524cc7456c90a155e06fae5ac6c2d0288trawick#
7416a4d524cc7456c90a155e06fae5ac6c2d0288trawick# Set the Release type that you want to build, possible values are:
855aa233fcb7b51d738fca5c36585646ae1960c3jerenkrantz#
7abe86bacd7821fb83a784398037defc64060a2emanoj# debug - full debug switches are set
306e22b1e932824368f6d9df002f72fb00e70ecdrjung# noopt - normal switches are set
132ee6ac1c26d6e8953836316ba50734eefab47bsf# release - optimization switches are set (default)
b4a00883f358625923365ca1560c96edec172a52sf
3a330c2331fc04f7d3f0ce7741bb52b5823f97e1wroweifdef reltype
3a330c2331fc04f7d3f0ce7741bb52b5823f97e1wroweRELEASE = $(reltype)
c803b0d84b48f151504b87ec3f196cb433149592rbbendif
ifdef RELTYPE
RELEASE = $(RELTYPE)
endif
ifdef debug
RELEASE = debug
endif
ifdef DEBUG
RELEASE = debug
endif
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
ifeq "$(REQUIRE_PROTOTYPES)" "1"
CFLAGS += -r
endif
# -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 = $(SRC)/$(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